Retrieve the number of words in a string.
~ ❯❯❯ npm install lexis-count
const lexisCount = require('lexis-count');
lexisCount('Lorem ipsum dolor sit amet')
//=> 5
lexisCount(' Lorem ipsum dolor sit amet ')
//=> 5
Type: string
Returns the number of words in a string.
- lexis - CLI for this module
- The regular expression used has been adapted from word-regex by regexhq.
MIT © Nikolaos Kamarinakis