substr-occurrence

1.1.0 • Public • Published

Substr Occurrence

forthebadge Build Status

A small, extremely lightweight library that counts the number of occurrences of a substring or single character in a larger string. Created because string-occurrence was too bloated and slow.

Installation

npm install codetheweb/substr-occurrence

Usage

var occurrence = require('substr-occurrence');
 
console.log(occurrence('o', 'foo bar');

Output should be 2.

Tests

npm test

/substr-occurrence/

    Package Sidebar

    Install

    npm i substr-occurrence

    Weekly Downloads

    0

    Version

    1.1.0

    License

    MIT

    Unpacked Size

    3.99 kB

    Total Files

    6

    Last publish

    Collaborators

    • codetheweb