1.0.1 • Published 5 years ago

wordcount.js v1.0.1

Weekly downloads
10
License
SEE LICENSE IN LI...
Repository
github
Last release
5 years ago

wordcount.js

An NPM module for counting words

Usage

Full documentation

Using wordcount.js is easy, just require it and call the function with a string.

var wordcount = require('wordcount.js');
var sentence = "Hello World, I'm Jim";
var wordcount = wordcount(sentence);
console.log(wordcount); // 4

You can also pass an array of strings using wordcount#countMultiple as shown below.

var wordcount = require('wordcount.js');

var strings = ["Hello, World", "Hi I'm Bob", "npm is the package manager for Node.js. It was created in 2009 as an open source project to help JavaScript developers easily share packaged modules of code."]
console.log(wordcount.countMultiple(strings)); // [ 2, 3, 27 ]
1.0.1

5 years ago

1.0.0

5 years ago