stoeffel / format-string

Format a string, using values from an object.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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"`

About

Format a string, using values from an object.


Languages

Language:JavaScript 100.0%