Socket
Socket
Sign inDemoInstall

sw-extract

Package Overview
Dependencies
0
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    sw-extract

Extracting stopwords from a string.


Version published
Weekly downloads
3
Maintainers
1
Install size
64.1 kB
Created
Weekly downloads
 

Readme

Source

sw-extract

NPM

Build Status Coverage Status node-current

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',          // Use english stopwords list (available languages: ar, en, fr)
    length: null,        // Set the length of the returned result (default return all result)
    wordLength: 3,       // Set the minimum length of the returned words (default is >= 3 chars)
    unique: true,        // Removes the duplicate keywords if set to true
    digits: false,       // Includes all digits if set to true
    toLower: false,      // Lower-cased all extracted keywords if set to true
    onlyDuplicate: false // Return only duplicated keywords if set to true
}

Credits

The Stopwords sources:

License

MIT

Use and abuse at your own risk.

Keywords

FAQs

Last updated on 16 Jun 2020

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc