A simple javascript stopwords extractor with 0 dependencies. demo
Installation
NPM
npm install sw-extract --save
CDN
https://unpkg.com/sw-extract@latest/dist/sw-extract.umd.min.js
Usage with a bundler
To use sw-extract with Webpack, Parcel or other bundler
import Keywords from 'sw-extract';
const text = 'Your Text...'
const options = {...}
const result = Keywords(text, options).toArray();
Usage in Browser directly
<script src="https://unpkg.com/sw-extract@latest/dist/sw-extract.umd.min.js"></script>
<body>
...
</body>
<script>
const text = 'Your Text...'
const options = {...}
const result = Keywords(text, options).toArray();
</script>
Using Options
{
lang: 'en',
length: null,
wordLength: 3,
unique: true,
digits: false,
toLower: false,
onlyDuplicate: false
}
Credits
The Stopwords sources:
License
MIT
Use and abuse at your own risk.