0.0.2 • Published 1 year ago

void-bulk-replace v0.0.2

Weekly downloads
-
License
MIT
Repository
-
Last release
1 year ago

void-bulk-replace 0.0.2

void-bulk-replace is a tool that let you replace All instances of a text in a string.

installation

npm install void-bulk-replace

How to use it

const { Replacer, Pair } = require('void-bulk-replace');

// example 1 : using an object

let replacer1 = new Replacer({
    '%1': 'Player.',
    '%2': '\nType',
    '%3': 'Help!'
}).apply('Hello there %1 %2 %3 %1');

console.log(replacer1);

// example 2 : using a pair

let replacer2 = new Replacer(new Pair('%s', 'Hello and Welcome!'));

console.log(replacer2.apply('%s \n%s \n%s \n%s'));

// example 3 : using Replace.of(left, right); instead of using a pair

let replacer3 = Replacer.of('%s', 'Hello and Welcome!');

console.log(replacer3.apply('%s \n%s \n%s \n%s'));
0.0.2

1 year ago

0.0.1

2 years ago