JSPM

substr-occurrence

1.1.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1
  • Score
    100M100P100Q20372F
  • License MIT

Gets the number of occurrences of a string or character in a string.

Package Exports

  • substr-occurrence

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (substr-occurrence) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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