wordpos module examples (https://github.com/moos/wordpos)
wordpos.getPOS( 'The angry bear chased the frightened little squirrel.', console.log );
// Output:
{
nouns: [ 'bear', 'squirrel', 'little', 'chased' ],
verbs: [ 'bear' ],
adjectives: [ 'little', 'angry', 'frightened' ],
adverbs: [ 'little' ],
rest: [ 'the' ]
}