Socket
Socket
Sign inDemoInstall

extractwords

Package Overview
Dependencies
Maintainers
0
Versions
6
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


Version published
Weekly downloads
233
decreased by-4.12%
Maintainers
0
Weekly downloads
 
Created
Source

extractwords

Extract the words from a string

Install

npm install extractwords

Usage

import extractWords from 'extractwords';

extractWords('Good morning, how are you?');
//=> ['Good', 'morning', 'how', 'are', 'you']

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

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

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('I . am ... go0d 2', {punctuation: true});
//=> ['I', '.', 'am', '...', 'go0d', '2']

API

extractWords(input, options?)

input

Type: string

Text containing words to be extracted.

options

Type: object

lowercase

Type: boolean
Default: false

Whether all words returned are lowercased.

punctuation

Type: boolean
Default: false

Whether all punctuation is retained.

Keywords

FAQs

Package last updated on 23 Aug 2024

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