0.0.2 • Published 11 years ago
Occurrences
Count the occurrences of a substring within a string.
Installation
$ npm install occurrences
Usage
var occurrences = require('occurrences');
occurrences('foobar', 'o', function(count) {
console.log(count);
});
Example
$ cd example
$ node demo.js
Test
$ npm install
$ make test