1.0.0 • Published 7 years ago

count-words-occurrence v1.0.0

Weekly downloads
4
License
MIT
Repository
github
Last release
7 years ago

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
1.0.0

7 years ago

0.0.4

8 years ago

0.0.3

8 years ago

0.0.2

8 years ago

0.0.1

8 years ago