1.0.2 • Published 6 years ago
placeholdify v1.0.2
placeholdify
Simple function to put placeholders in strings.
Install
npm install placeholdifyUsage
const placeholdify = require('placeholdify');
placeholdify('foo {1} baz {0}', 'qux', 'bar');
//=> foo bar baz quxplaceholdify(format[, value, ...])
format
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.
value
Type: mixed
Values to insert into the format string.