void-bulk-replace
TypeScript icon, indicating that this package has built-in type declarations

0.0.2 • Public • Published

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'));

/void-bulk-replace/

    Package Sidebar

    Install

    npm i void-bulk-replace

    Weekly Downloads

    1

    Version

    0.0.2

    License

    MIT

    Unpacked Size

    4.61 kB

    Total Files

    6

    Last publish

    Collaborators

    • mrthomas20121