just-the-words
v0.1.2
Published
Isolate the words from a given body of text.
Downloads
6
Readme
just-the-words
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: '’-