count-words-occurrence

1.0.0 • Public • Published

Count words occurrence

npm version Build Status

Installation

npm install --save count-words-occurrence

Usage

Import the module in your application:

// From ES6
import countWords from 'count-words-occurrence'

// From CJS
const countWords = require('count-words-occurrence');

// From global
const countWords = countWordsOccurrence.default;

// Then use it juste like that:
const result = countWords(input, options);

Documentation

countWords(input, options);

input

Type: string

options.caseSensitive

Type: boolean | default: false

options.minLength

Type: number | default: 2

The minimum length of words to count.

options.predicates

Type: Array<(x: string) => boolean> | default: []

An array of functions to apply to each word for enable custom filters.

Run the test

npm test

Readme

Keywords

none

Package Sidebar

Install

npm i count-words-occurrence

Weekly Downloads

0

Version

1.0.0

License

MIT

Last publish

Collaborators

  • samouss