words es-toolkit
Splits a string into an array of words.
Usage
words(str)
Use words when you want to split a string into individual words. It splits words based on camelCase, kebab-case, spaces, punctuation, and correctly recognizes emojis and Unicode characters. It's useful when processing strings with various naming conventions.
Useful for splitting strings into words in various situations:
Parameters
strstringrequired
The string to split into words.
Returns
Returns an array of words split from the string.
Source: es-toolkit
Re-exported verbatim from es-toolkit. Implementation, edge cases, and performance behavior are owned upstream. This page mirrors the documentation at the pinned version; the linked source is authoritative.