Replace your string variables by your values easily.
$ cnpm install stimmy
This module provides a string variables replacer.
$ npm install stimmy --save
From import
import stimmy from 'stimmy';
From require
const stimmy = require('stimmy');
const str = stimmy('This {0} is {1}!', ['module', 'awesome']);
// This module is awesome!
const str = stimmy('{0}% of code coverage, it\'s {1}...', [100, 'so amazing']);
// 100% of code coverage, it's so amazing...
const str = stimmy('{timmy} My hobby is {hobby}...', {timmy: 'Timmmmmmmyy !!', hobby: 'running'});
// Timmmmmmmyy !! My hobby is running...
const str = stimmy('My name is {name}, I\'m {age}.', {name: 'stimmy', age: 25});
// My name is stimmy, I'm 25.
Run using npm run <script> command.
clean - remove coverage data, Jest cache and transpiled files,
lint - lint source files and tests,
typecheck - check type annotations,
test - lint, typecheck and run tests with coverage,
test-only - run tests with coverage,
test:watch - interactive watch mode to automatically re-run tests,
build - compile source files,
build:watch - interactive watch mode, compile sources on change.
MIT © Dimitri DO BAIRRO
Copyright © npmmirror.com | 浙ICP备15033595号-63 |