/placeholdify

Simple placeholder utility for strings

Primary LanguageJavaScriptMIT LicenseMIT

placeholdify

NPM Build status Maintainability status Coverage status Bundle size Code style: XO Release: Semantic

Simple function to put placeholders in strings.

Install

npm install placeholdify

Usage

const placeholdify = require('placeholdify');

placeholdify('foo {1} baz {0}', 'qux', 'bar');
//=> foo bar baz qux

placeholdify(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.

Contributing

Contributions are always welcome! Please run npm test beforehand to ensure everything is ok.

Support

If you use this package please consider starring it :)