count2word

1.0.2 • Public • Published

count2word

Calculate the number of occurrences of each word in a text. Words less than two letters are ignored.

Installation

$ npm i -S count2word

Example

const count2Word = require('count2word');
 
console.log(count2Word('We travel not to escape life, but for life not to escape us.'));
// => { we: 1, travel: 1, not: 2, to: 2, escape: 2, life: 2, but: 1, for: 1, us: 1 }

Tests

  • clone the repository

  • install mocha and chai

$ npm i
  • launch the tests
$ npm run test

Readme

Keywords

Package Sidebar

Install

npm i count2word

Weekly Downloads

1

Version

1.0.2

License

MIT

Last publish

Collaborators

  • l0dz