format-string
v1.0.0
Published
replaces values in a string with content from a object
Downloads
16
Readme
format-string
Format a string, using values from an object.
Installation
npm install format-string
Usage
var formatString = require('format-string');
var user = {
name: 'Stoeffel',
modified: new Date()
};
formatString('Hello, :name (:modified)', user); // => Hello, Stoeffel (31.12.2014)
CLI
$ format-string 'Hello, :name (:modified)' --name stoeffel --modified `date +"%m.%d.%y"`