Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

extractwords

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

extractwords

Extract the words from a string

  • 1.1.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
82
decreased by-22.64%
Maintainers
1
Weekly downloads
 
Created
Source

extractwords Build Status

Install

$ npm install extractwords

Usage

const extractwords = require('extractwords');

extractwords('Good Morning, how are you?');
//=> ['Good', 'Morning', 'how', 'are', 'you']

extractwords('Good morning, how are you?', {lowercase: true});
//=> ['good', 'morning', 'how', 'are', 'you']

extractwords('Good Morning, how are you?', {punctuation: true});
//=> ['Good', 'Morning,', 'how', 'are', 'you?']

extractwords('Great work ... son.', {punctuation: true});
//=> ['Great', 'work', 'son.']

extractwords("He didn't pay for his meal m'aam");
//=> ['He', "didn't", 'pay', 'for', 'his', 'meal', "m'aam"]

extractwords("17651Hello*&!(*2I'm_++`~gOOd");
//=> ['Hello', "I'm", 'gOOd']


API

extractwords(str, [options])

str

Type: string

Text containing words to be extracted.

options

Type: object

lowercase

Type: boolean
Default: false

If true, all words returned are lowercased.

punctuation

Type: boolean
Default: false

If true, all punctuation next to words are retained.

Keywords

FAQs

Package last updated on 03 Jun 2019

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc