8000 GitHub - larube/occurence-finder: A small module to find occurrences in a text
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

larube/occurence-finder

Repository files navigation

occurence-finder

Works on Browser and Node

npm run build

In dist folder, you will find node version(occurence-finder.js) and browser version(occurence-finder.umd.js)

API

Module exports a simple function

/**
 * findNbOccurencesInText
 *
 * @description
 * Returns the number occurences of a word in a text
 *
 * * @param {string} text
 * * @param {string} needle
 *
 * @returns {int}
 */

function findNbOccurencesInText(text[], needle[])

Usage

const occurenceFinder = require('occurrence-finder')

const text = 'Lorem ipsum ...'

const nbOcurrncesInText = occurenceFinder(text, 'lorem')

License

MIT

About

A small module to find occurrences in a text

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
0