Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tornqvist/jazzon-format
Format strings using util.format
https://github.com/tornqvist/jazzon-format
Last synced: about 1 month ago
JSON representation
Format strings using util.format
- Host: GitHub
- URL: https://github.com/tornqvist/jazzon-format
- Owner: tornqvist
- Created: 2015-10-22T11:24:33.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2015-10-22T11:24:50.000Z (about 9 years ago)
- Last Synced: 2024-11-13T15:07:26.750Z (about 1 month ago)
- Language: JavaScript
- Size: 105 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# jazzon-format
> Format strings using `util.format`
## Usage
Here is an example where we're using it together with [jazzon-faker](https://github.com/tornqvist/jazzon-faker) to wrap a lipsum text in `p` tags.
```
const jazzon = require('jazzon');
const faker = require('jazzon-faker');
const format = require('jazzon-format');
const json = { title: '@{ lorem.sentences(3) | format(%s
) }' };jazzon
.use(faker())
.use(format())
.compile(json)
.then((result) => {
console.log(result); // => { "title": "Lorem ipsum dolor sit…
" }
});
```## Licence
MIT