Install
$ npm install extractwords
Usage
const extractwords = require('extractwords');
extractwords('Good Morning, how are you?');
extractwords('Good morning, how are you?', {lowercase: true});
extractwords('Good Morning, how are you?', {punctuation: true});
extractwords('Great work ... son.', {punctuation: true});
extractwords("He didn't pay for his meal m'aam");
extractwords("17651Hello*&!(*2I'm_++`~gOOd");
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 next to words are retained.