Install
$ npm install extractwords
Usage
const extractwords = require('extractwords');
extractwords('Good Morning, how are you?');
extractwords("He didn't pay for his meal m'aam");
extractwords("17651Hello*&!(*2I'm_++`~gOOd 2");
extractwords('Good morning, how are you?', {lowercase: true});
extractwords('Good Morning. how are you?', {punctuation: true});
extractwords('I . am ... go0d 2', {punctuation: true});
API
str
Type: string
Text containing words to be extracted.
options
Type: object
lowercase
Type: boolean
Default: false
If true
, all words returned are lowercased.
punctuation
Type: boolean
Default: false
If true
, all punctuation is retained.