2.1.0 • Published 9 months ago

extractwords v2.1.0

Weekly downloads
11
License
CC0-1.0
Repository
github
Last release
9 months ago

extractwords

Extract the words from a string

Install

npm install extractwords

Usage

import extractWords from 'extractwords';

extractWords('Good morning, how are you?');
//=> ['Good', 'morning', 'how', 'are', 'you']

extractWords("He didn't pay for his meal m'aam");
//=> ['He', "didn't", 'pay', 'for', 'his', 'meal', "m'aam"]

extractWords("17651Hello*&!(*2I'm_++`~gOOd 2");
//=> ['Hello', "I'm", 'gOOd']

extractWords('Good morning, how are you?', {lowercase: true});
//=> ['good', 'morning', 'how', 'are', 'you']

extractWords('Good Morning. how are you?', {punctuation: true});
//=> ['Good', 'Morning.', 'how', 'are', 'you?']

extractWords('I . am ... go0d 2', {punctuation: true});
//=> ['I', '.', 'am', '...', 'go0d', '2']

API

extractWords(input, options?)

input

Type: string

Text containing words to be extracted.

options

Type: object

lowercase

Type: boolean\ Default: false

Whether all words returned are lowercased.

punctuation

Type: boolean\ Default: false

Whether all punctuation is retained.

2.1.0

9 months ago

2.0.0

10 months ago

1.2.0

5 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago