1.1.4 • Published 1 year ago

fmtr v1.1.4

Weekly downloads
214
License
ISC
Repository
github
Last release
1 year ago

fmtr

Awesome string formatting using shell style place holders.

Installation

npm install --save fmtr

API

fmtr(format, obj)

Parameters:

  • format string with ${propertyName} placeholder(s) where propertyName is the name of a property of obj
  • obj an object containing values to substitute into the format string.

Returns:

  • string

Example

"use strict";

var fmtr = require('fmtr');

var user = {
    username: 'alice',
    spouse: 'bob',
    enemy: 'eve'
};

console.log(fmtr('${username} is married to ${spouse} and hates ${enemy}', user));

// prints "alice is married to bob and hates eve"

Testing

npm test

License

See LICENSE.md

1.1.4

1 year ago

1.1.3

3 years ago

1.1.2

5 years ago

1.1.1

5 years ago

1.1.0

7 years ago

1.0.5

7 years ago

1.0.4

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago