Get the visual width of a string - the number of columns required to display it
☆520Feb 18, 2026Updated last week
Alternatives and similar repositories for string-width
Users that are interested in string-width are comparing it to the libraries listed below
Sorting:
- Get the real length of a string - by correctly counting astral symbols and ignoring ansi escape codes☆170Jan 21, 2026Updated last month
- Get the visual width of the widest line in a string - the number of columns required to display it☆40Jan 24, 2026Updated last month
- Check if the character represented by a given Unicode code point is fullwidth☆51Aug 31, 2025Updated 6 months ago
- Node.js 0.12 path.isAbsolute() ponyfill☆43Jan 24, 2021Updated 5 years ago
- Check if a file path is a binary file☆49Apr 30, 2024Updated last year
- Gracefully restore the CLI cursor on exit☆41Jul 26, 2024Updated last year
- Wordwrap a string with ANSI escape codes☆134Feb 20, 2026Updated last week
- Get the PATH environment variable key cross-platform☆46Sep 12, 2025Updated 5 months ago
- Check if a value is a plain object☆104May 4, 2024Updated last year
- Check if a number is a redirect HTTP status code☆25Apr 17, 2021Updated 4 years ago
- Check if a path is the current working directory☆22May 10, 2025Updated 9 months ago
- Similar to String#trim() but removes only whitespace on the right☆22Jul 9, 2021Updated 4 years ago
- Check if a path is a file, directory, or symlink☆80Feb 2, 2026Updated 3 weeks ago
- Truncate a string to a specific width in the terminal☆88Oct 23, 2025Updated 4 months ago
- Check if argv has a specific flag☆96Jul 19, 2021Updated 4 years ago
- Reliably get the terminal window size☆146Feb 2, 2026Updated 3 weeks ago
- Prepend `https://` to humanized URLs like `sindresorhus.com` and `localhost`☆66Sep 9, 2025Updated 5 months ago
- Get your PATH prepended with locally installed binaries☆107Oct 28, 2024Updated last year
- Repeat a string - fast☆35May 3, 2021Updated 4 years ago
- Check if a path is in the current working directory☆23May 3, 2021Updated 4 years ago
- Get a random key from an object☆18Jul 2, 2024Updated last year
- Check if a value is an object☆42Apr 16, 2021Updated 4 years ago
- Toggle the CLI cursor☆113Jul 26, 2024Updated last year
- Check if something is a Node.js stream☆115Oct 28, 2024Updated last year
- Unpipe a stream from all destinations☆22Dec 15, 2020Updated 5 years ago
- Split a string at one or more indices☆25May 3, 2021Updated 4 years ago
- Fallback to a default if `process.stdout.getWindowSize` doesn't exist☆24Jan 21, 2026Updated last month
- Regular expression for matching a shebang line☆48Aug 13, 2021Updated 4 years ago
- Callback wrapping utility☆56Feb 10, 2024Updated 2 years ago
- Try to guess if your terminal supports unicode☆18Dec 16, 2020Updated 5 years ago
- Check if a path exists☆155Mar 3, 2022Updated 3 years ago
- Check if a path is inside another path☆40Sep 11, 2025Updated 5 months ago
- Lowercase the keys of an object☆41Feb 2, 2026Updated 3 weeks ago
- Detect whether or not an object is a Typed Array☆21Jan 23, 2024Updated 2 years ago
- Invert the key/value of an object. Example: {foo: 'bar'} → {bar: 'foo'}☆37Feb 26, 2022Updated 4 years ago
- ES2015 Number.isFinite() ponyfill☆20Apr 7, 2021Updated 4 years ago
- Get a random property from an object☆15Jul 2, 2024Updated last year
- Prepend `https://` to humanized URLs like `sindresorhus.com` and `file://` to file paths☆25Jul 9, 2022Updated 3 years ago
- node's assert.deepEqual algorithm except for the fact that (NaN === NaN) and (+0 !== -0).☆21Sep 4, 2021Updated 4 years ago