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

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.1.2
    0
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.1.2
    0
  • 0.1.1
    0
  • 0.1.0
    0

Package Sidebar

Install

npm i just-the-words

Weekly Downloads

0

Version

0.1.2

License

ISC

Unpacked Size

2.39 kB

Total Files

3

Last publish

Collaborators

  • seanmcp