npm

Need private packages and team management tools?Check out npm Orgs. »

combo-breaker

0.0.1 • Public • Published

combo-breaker

Break consecutive repetition of a string in Node.js and browsers.

Examples

var comboBreaker = require('combo-breaker'),
    redundant,
    broken
;
 
redundant = 'I really really really really love pizza.';
 
broken = comboBreaker(redundant, 'really ');
console.log(broken); // "I really love pizza."
 
broken = comboBreaker(redundant, 'really ', { keep: 2 });
console.log(broken); // "I really really love pizza."
 

API

comboBreaker(str, combo[, options])

Searches string str for consecutive repetitions of combo and returns a copy of str with the repetitions replaced by a single combo. Use options.keep (integer) to keep more than one (or no) combo.

Install

Install with npm:

npm install combo-breaker

License

ISC

install

npm i combo-breaker

Downloadsweekly downloads

4

version

0.0.1

license

ISC

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability