String formatting library inspired from Python
JavaScript
Switch branches/tags
Nothing to show
Latest commit a37e507 Nov 30, 2016 @azer committed on GitHub Update index.js
Permalink
Failed to load latest commit information.
.gitignore
.npmignore
.travis.yml
README.md
index.js
package.json
test.js

README.md

format-text

String formatting library inspired from Python

Install

$ npm install new-format

Usage

format = require('format-text')

format('Hello {0}. The weather is currently {1}°.', 'Kitty', '67')
// => Hello Kitty. The weather is currently 67°.

format('Hello {name}, The weather is currently {degree}°', { name:'Kitty', degree: 67 })
// => Hello Kitty. The weather is currently 67°.