https://github.com/azer/format-text
String formatting library inspired from Python
https://github.com/azer/format-text
Last synced: 11 months ago
JSON representation
String formatting library inspired from Python
- Host: GitHub
- URL: https://github.com/azer/format-text
- Owner: azer
- Created: 2013-03-24T04:29:20.000Z (about 13 years ago)
- Default Branch: master
- Last Pushed: 2020-11-24T15:57:40.000Z (over 5 years ago)
- Last Synced: 2025-07-11T23:21:00.239Z (11 months ago)
- Language: JavaScript
- Homepage:
- Size: 8.79 KB
- Stars: 10
- Watchers: 1
- Forks: 7
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## format-text
String formatting library inspired from Python
### Install
```bash
$ npm install azer/format-text
```
### Usage
```js
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°.
```
