Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@yoando/repetition-counter

yoando1MIT1.0.3

Count how many times words appear in the input string.

word, counter, repetition, npm, package, yoando

readme

@YoanDo/repetition-counter

Repetition-counter

a short package to check words repetition in a sentence

Install

$ npm install @yoando/repetition-counter

Usage

const repCounter = require("@yoando/repetition-counter");

repCounter(string, caseInsensitive) caseInsensitive is true by default

repCounter("Pump up the jam, pump it up", true); //=> { pump: 2, up: 2, the: 1, jam: 1, it: 1 }

repCounter("Pump up the jam, pump it up", false); //=> { Pump: 1, up: 2, the: 1, jam: 1, pump: 1, it: 1 }