str-to-arr
: Add words from a string to an array
str-to-arr extract the words from a string, and store those words in an array. The words are separated by a black space/s (' ')
.
We want to accept the user to add his/her own custom regex properties, but that isn’t yet covered.
Now all characters are valid strings, instead of the v1.0.0 where not any characters was supported. This version still convert the words to lower case.
I currently use this module on init-pkg-json-cli to accept multiple keywords in just one argument.
npm install str-to-arr
const strToArr = require('str-to-arr');
console.log(strToArr('This s$tring has_number3s and hyp-hens'));
// => [ 'this', 's$tring', 'has_number3s', 'and', 'hyp-hens' ]
Carlos Abraham |
MIT License © Carlos Abraham