AI Coding Assistants

string-length

Get the real length of strings with astral symbols and ansi escape codes support.

Status
Generally available
Last checked
Checked · Nov 21, 2026
License
Open source
Pricing
Free tier · from $0

What it is

string-length is a tool that accurately calculates the length of strings, taking into account astral symbols and ignoring ansi escape codes. This ensures precise string length calculations in various applications.

string-length stands out by providing accurate string length calculation, especially useful in environments with complex character sets like astral symbols and ansi escape codes.

Maintenance status

Generally available

Evidence: Actively maintained open-source project.

Read from github.com/sindresorhus/string-length ↗ · last commit Jul 25, 2026 · repository read Nov 21, 2026

Last checked Nov 21, 2026 by an automated check of its repository, package or website.

When it fits — and when it doesn’t

A good fit for

  • JavaScript developers who need accurate string length calculation in their projects.

  • Projects dealing with internationalization where astral symbols are common.

  • Applications requiring consistent handling of strings across different platforms.

Look elsewhere if

  • Scenarios where performance is critical and the overhead of additional calculations cannot be tolerated.

  • Use cases that do not require consideration for astral symbols or ansi escape codes.

Known weaknesses

Each one links to the public issue, changelog or docs page it came from, where we have one.

  1. 01

    Limited language support

    The tool is primarily designed for JavaScript, limiting its utility in non-JavaScript environments.

  2. 02

    Small community and maintenance concerns

    Given that it's an open-source project with a narrow focus, the community might be small, leading to slower issue resolution and feature development.

  3. 03

    Potential performance overhead for large strings

    The tool needs to process each character carefully to handle astral symbols and ansi escape codes, which could introduce a slight performance penalty for very long strings.

What it does well

  • Correctly counts astral symbols in strings.

  • Ignores ansi escape codes for accurate length calculation.

  • Easy to integrate as a library.

Pricing

Free tier
YesOpen source — free to use
Paid from
$0
Model
Flat rate
Enterprise plan
No

Pricing not independently confirmed — check the vendor’s page.

Set up string-length

No step-by-step guide on file yet — the setup page points to the official docs and sign-up.

Open the setup guide →