just-the-words

0.1.2 • Public • Published

just-the-words

npm npm bundle size (minified) npm

Isolate the words from a given block of text.

Examples

justTheWords('Hello, world');
// -> ['Hello', 'world']
 
justTheWords('Two\nlines');
// -> ['Two', 'lines']
 
justTheWords('Now\rwe\'re\ngoing\tcrazy');
// -> ['Now', 'we\'re', 'going', 'crazy']
 
justTheWords('Spider-man? He\'s my favorite!');
// -> ['Spider-man', 'He\'s', 'my', 'favorite']

Install

npm install just-the-words
yarn add just-the-words

Use

const justTheWords = require('just-the-words');
import justTheWords from 'just-the-words';
 
console.log(justTheWords('Hello world!'))
// -> ['Hello', 'world']

API

justTheWords(
    content:string,
    safeCharacters?:string,
    overrideDefaultSafeCharacters?:boolean
)

Default safe characters: '’-

Author

Sean McPherson

Readme

Keywords

Package Sidebar

Install

npm i just-the-words

Weekly Downloads

1

Version

0.1.2

License

ISC

Unpacked Size

2.39 kB

Total Files

3

Last publish

Collaborators

  • seanmcp