cb

combo-breaker

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

Showing:

Popularity

Downloads/wk

1

GitHub Stars

4

Maintenance

Last Commit

7yrs ago

Contributors

0

Package

Dependencies

1

Size (min+gzip)

0.3KB

License

ISC

Type Definitions

Tree-Shakeable

No?

Categories

Readme

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

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100