needle-string

1.0.0 • Public • Published

needle-string

Count case-sensitive occurrences of a string in a string (like needles in a haystack)

Build Status

Install

$ npm install --save needle-string

Usage

const needles = require('needle-string');
 
needles('magical unicorns are magic', 'magic');
//=> 2

API

needleString(haystack, needle)

Returns the number of case-sensitive strings ('needles') in a string ('haystack') of text.

haystack

Type: string

The string of text you want to search.

needle

Type: string

The string you want to count the occurrences of.

License

MIT © Michael Wuergler

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.0
    530
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.0
    530
  • 0.0.4
    2
  • 0.0.3
    3
  • 0.0.2
    3
  • 0.0.1
    3

Package Sidebar

Install

npm i needle-string

Weekly Downloads

278

Version

1.0.0

License

MIT

Last publish

Collaborators

  • radiovisual