Count case-sensitive occurrences of a string in a string (like needles in a haystack)
$ npm install --save needle-string
const needles = require('needle-string');
needles('magical unicorns are magic', 'magic');
//=> 2
Returns the number of case-sensitive strings ('needles') in a string ('haystack') of text.
Type: string
The string of text you want to search.
Type: string
The string you want to count the occurrences of.
MIT © Michael Wuergler