Skip to content
JS
Package category

Strings and text

Slugify, escape, pad, pluralise, diff and transform text.

205 packages1 comparisons

Packages compared

205 packages
PackageWeekly downloads12-month change52 weeksGzipLast releaseModuleTypesCategories
camelcase
Convert a dash/dot/underscore/space separated string to camelCase or PascalCase: `foo-bar` → `fooBar`
142.1m+26%-10 months ago
9.0.0
ESM onlyBundledStrings and text
strip-bom
Strip UTF-8 byte order mark (BOM) from a string
116.3m+53%-5 years ago
5.0.0
ESM onlyNoneStrings and text
kind-of
Get the native type of a value.
115.1m+4%-6 years ago
6.0.3
CommonJSNoneDate and time, Strings and text
indent-string
Indent each line in a string
79.6m+65%-5 years ago
5.0.0
ESM onlyNoneStrings and text
is-string
Is this value a JS String object or primitive? This module works cross-realm/iframe, and despite ES6 @@toStringTag.
67.9m+72%-1 year ago
1.1.1
CommonJSBundledStrings and text
string.prototype.trim
ES5 spec-compliant shim for String.prototype.trim
63.1m+88%-3 months ago
1.2.11
CommonJSNonePolyfills and shims, Strings and text
get-east-asian-width
Determine the East Asian Width of a Unicode character
57.5m+311%-8 days ago
1.7.0
ESM onlyBundledInternationalisation, Strings and text
decamelize
Convert a camelized string into a lowercased one with a custom separator: unicornRainbow → unicorn_rainbow
53.7m+47%-1 year ago
6.0.1
ESM onlyBundledStrings and text
leven
Measure the difference between two strings using the Levenshtein distance algorithm
49m+53%-1 year ago
4.1.0
ESM onlyBundledStrings and text
string-length
Get the real length of a string - by correctly counting astral symbols and ignoring ansi escape codes
41.3m+24%-8 months ago
7.0.1
ESM onlyBundledCLI tools and terminal utilities, Strings and text
lodash.camelcase
The lodash method `_.camelCase` exported as a module.
39.8m+99%-10 years ago
4.3.0
-NoneStrings and text
ccount
Count how often a character (or substring) is used in a string
38.2m+241%-4 years ago
2.0.1
ESM onlyBundledStrings and text
camelcase-css
Convert a kebab-cased CSS property into a camelCased DOM property.
28.8m+113%-8 years ago
2.0.1
CommonJSNoneStrings and text, CSS-in-JS and styling
pluralize
Pluralize and singularize any word
27.2m+88%-7 years ago
8.0.0
CommonJSNoneStrings and text
@babel/plugin-transform-unicode-sets-regex
Compile regular expressions' unicodeSets (v) flag.
26.5m+45%-3 months ago
8.0.1
ESM onlyBundledStrings and text
camel-case
Transform into a string with the separator denoted by the next word capitalized
24.3m+14%-2 years ago
5.0.0
ESM onlyNoneStrings and text
fast-string-truncated-width
A fast function for calculating where a string should be truncated, given an optional width limit and an ellipsis string.
24.1m+37628%-11 months ago
3.0.3
ESM onlyBundledCLI tools and terminal utilities, Strings and text
fast-string-width
A fast function for calculating the visual width of a string once printed to the terminal.
23.9m+66487%-11 months ago
3.0.2
ESM onlyBundledCLI tools and terminal utilities, Strings and text
@babel/plugin-syntax-unicode-sets-regex
Parse regular expressions' unicodeSets (v) flag.
23.8m+38%-4 years ago
7.18.6
CommonJSNoneStrings and text
crypto-random-string
Generate a cryptographically strong random string
23.8m+32%-2 months ago
6.0.0
ESM onlyBundledCryptography and hashing, Strings and text
unique-string
Generate a unique random string
23.6m+32%-5 years ago
3.0.0
ESM onlyNoneStrings and text
change-case
Transform a string between `camelCase`, `PascalCase`, `Capital Case`, `snake_case`, `kebab-case`, `CONSTANT_CASE` and others
21.6m+90%-2 years ago
5.4.4
ESM onlyBundledStrings and text
repeat-string
Repeat the given string n times. Fastest implementation for repeating a string.
18.2m-1%-9 years ago
1.6.1
CommonJSNoneStrings and text
camelcase-keys
Convert object keys to camel case
17.2m+5%-4 days ago
10.0.3
ESM onlyBundledStrings and text
expand-template
Expand placeholders in a template string
16.2m+112%-7 years ago
2.0.3
CommonJSNoneStrings and text
split-on-first
Split a string on the first occurance of a given separator
13.2m+75%-1 year ago
4.0.0
ESM onlyBundledStrings and text
split-string
Easy way to split a string on a given character unless it's quoted or escaped.
11.6m+4%-7 years ago
6.1.0
CommonJSBundledStrings and text
pascalcase
Convert a string to pascal case (upper camelcase).
9.9m-21%-4 years ago
2.0.0
ESM onlyNoneStrings and text
decamelize-keys
Convert object keys from camel case
9.9m+10%-4 days ago
2.1.0
ESM onlyBundledStrings and text
hyphenate-style-name
Hyphenates a camelcased CSS property name
9.7m+76%-2 years ago
1.1.0
ESM + CommonJSBundledStrings and text
js-levenshtein
The most efficient JS implementation calculating the Levenshtein distance, i.e. the difference between two strings.
8.6m+102%-7 years ago
1.1.6
-NoneStrings and text
pupa
Simple micro templating
8.1m+43%-1 year ago
3.3.0
ESM onlyBundledTemplating, Strings and text
strip-bom-string
Strip a byte order mark (BOM) from a string.
7.6m+206%-9 years ago
1.0.0
CommonJSNoneStrings and text
repeating
Repeat a string - fast
5.4m-11%-5 years ago
4.0.0
ESM onlyNoneStrings and text
nlcst-to-string
nlcst utility to transform a tree to a string
4.9m+364%-3 years ago
4.0.0
ESM onlyBundledStrings and text
is-primitive
Returns `true` if the value is a primitive.
4.1m-10%-8 years ago
3.0.1
CommonJSNoneStrings and text
@sindresorhus/transliterate
Convert Unicode characters to Latin characters using transliteration
4m+220%-8 months ago
2.3.1
ESM onlyBundledStrings and text
inflection
A port of inflection-js to node.js module
3.8m+20%-1 year ago
3.0.2
CommonJSBundledStrings and text, Utility libraries
speakingurl
Generate a slug – transliteration with a lot of options
3.6m+76%-9 years ago
14.0.1
CommonJSNoneStrings and text
@hexagon/base64
Base64 and base64url to string or arraybuffer, and back. Node, Deno or browser.
3.3m+452%-1 year ago
2.0.4
ESM + CommonJSBundledStrings and text, Cryptography and hashing
parse-css-color
parse a css color string
2.7m+595%-4 years ago
0.2.1
ESM + CommonJSBundledCSS-in-JS and styling, Strings and text
underscore.string
String manipulation extensions for Underscore.js javascript library.
2.4m+3%-4 years ago
3.3.6
CommonJSNoneStrings and text, Utility libraries
html-comment-regex
Regular expression for matching HTML comments
2.2m+20%-7 years ago
1.1.2
-NoneStrings and text, Testing
align-text
Align the text in a string.
2.2m-19%-9 years ago
1.0.2
CommonJSNoneStrings and text
titleize
Capitalize every word in a string: `unicorn cake` → `Unicorn Cake`
2.2m+1%-3 years ago
4.0.0
ESM onlyBundledStrings and text
center-align
Center-align the text in a string.
2.1m-18%-9 years ago
1.0.1
CommonJSNoneStrings and text
right-align
Right-align the text in a string.
2.1m-9%-11 years ago
0.1.3
CommonJSNoneStrings and text
obj-case
Work with objects of different cased keys
1.7m+108%-5 years ago
0.2.1
CommonJSNoneStrings and text
@ethersproject/strings
String utility functions.
1.5m---1 year ago
5.8.0
--Blockchain and Web3, Strings and text
to-no-case
Remove any existing casing from a string.
1.4m+25%-9 years ago
1.0.2
--Strings and text

12-month change compares the average of the last 4 weeks of downloads with the first 4 weeks of the 52-week series. Gzip size is for the whole package, as measured by Bundlephobia. "-" means the value has not been fetched.

  • camelcaseConvert a dash/dot/underscore/space separated string to camelCase or PascalCase: `foo-bar` → `fooBar`
  • strip-bomStrip UTF-8 byte order mark (BOM) from a string
  • kind-ofGet the native type of a value.
  • indent-stringIndent each line in a string
  • is-stringIs this value a JS String object or primitive? This module works cross-realm/iframe, and despite ES6 @@toStringTag.
  • string.prototype.trimES5 spec-compliant shim for String.prototype.trim
  • get-east-asian-widthDetermine the East Asian Width of a Unicode character
  • decamelizeConvert a camelized string into a lowercased one with a custom separator: unicornRainbow → unicorn_rainbow
  • levenMeasure the difference between two strings using the Levenshtein distance algorithm
  • string-lengthGet the real length of a string - by correctly counting astral symbols and ignoring ansi escape codes
  • lodash.camelcaseThe lodash method `_.camelCase` exported as a module.
  • ccountCount how often a character (or substring) is used in a string
  • camelcase-cssConvert a kebab-cased CSS property into a camelCased DOM property.
  • pluralizePluralize and singularize any word
  • @babel/plugin-transform-unicode-sets-regexCompile regular expressions' unicodeSets (v) flag.
  • camel-caseTransform into a string with the separator denoted by the next word capitalized
  • fast-string-truncated-widthA fast function for calculating where a string should be truncated, given an optional width limit and an ellipsis string.
  • fast-string-widthA fast function for calculating the visual width of a string once printed to the terminal.
  • @babel/plugin-syntax-unicode-sets-regexParse regular expressions' unicodeSets (v) flag.
  • crypto-random-stringGenerate a cryptographically strong random string
  • unique-stringGenerate a unique random string
  • change-caseTransform a string between `camelCase`, `PascalCase`, `Capital Case`, `snake_case`, `kebab-case`, `CONSTANT_CASE` and others
  • repeat-stringRepeat the given string n times. Fastest implementation for repeating a string.
  • camelcase-keysConvert object keys to camel case
  • expand-templateExpand placeholders in a template string
  • split-on-firstSplit a string on the first occurance of a given separator
  • split-stringEasy way to split a string on a given character unless it's quoted or escaped.
  • pascalcaseConvert a string to pascal case (upper camelcase).
  • decamelize-keysConvert object keys from camel case
  • hyphenate-style-nameHyphenates a camelcased CSS property name
  • js-levenshteinThe most efficient JS implementation calculating the Levenshtein distance, i.e. the difference between two strings.
  • pupaSimple micro templating
  • strip-bom-stringStrip a byte order mark (BOM) from a string.
  • repeatingRepeat a string - fast
  • nlcst-to-stringnlcst utility to transform a tree to a string
  • is-primitiveReturns `true` if the value is a primitive.
  • @sindresorhus/transliterateConvert Unicode characters to Latin characters using transliteration
  • inflectionA port of inflection-js to node.js module
  • speakingurlGenerate a slug – transliteration with a lot of options
  • @hexagon/base64Base64 and base64url to string or arraybuffer, and back. Node, Deno or browser.
  • parse-css-colorparse a css color string
  • underscore.stringString manipulation extensions for Underscore.js javascript library.
  • html-comment-regexRegular expression for matching HTML comments
  • align-textAlign the text in a string.
  • titleizeCapitalize every word in a string: `unicorn cake` → `Unicorn Cake`
  • center-alignCenter-align the text in a string.
  • right-alignRight-align the text in a string.
  • obj-caseWork with objects of different cased keys
  • @ethersproject/stringsString utility functions.
  • to-no-caseRemove any existing casing from a string.