extw
Tiny utility that extracts words from a given string and caches parsed result lists.
Usage
const words = // [ 'Buggy', 'is', 'my', 'beautiful', 'cat' ]
API
const extw = typeof extw === 'function' // returns a string array // returns the given array untouched // returns an empty array // raises an assert.AssertionError // disable cache for _this_ call // use the given object as cache for _this_ call typeof extwcache === 'object' extwcache = {} // reset cacheextwcache = false // disable cacheextwcache = 'error' // raises an assert.AssertionError extwregExp instanceof RegExp === true extwregExp = /a+/g // override word match regexpextwregExp = 'error' // raises an assert.AssertionError typeof extwversion === 'string' // returns the version string from package manifest
Installation
With npm:
npm install extw