Simple function to put placeholders in strings.
npm install placeholdify
const placeholdify = require('placeholdify');
placeholdify('foo {1} baz {0}', 'qux', 'bar');
//=> foo bar baz qux
Type: string
String containing the placeholders.
Placeholders must be in the format {n}
(example: {0}
, {1}
, etc.), being n
the index of the value to insert into.
Type: mixed
Values to insert into the format
string.
Contributions are always welcome! Please run npm test
beforehand to ensure everything is ok.
If you use this package please consider starring it :)