Skip to content

Commit

Permalink
docs
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonSchick committed Mar 6, 2016
1 parent 08a4c53 commit 2d08bd2
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,27 @@ JSON formatting special:

I added JSON formatting for convenience reasons(because I could), in order to use prettyfied json you need to pass the padding specifier eg.

````
```javascript
console.log(esprintf('%\'\tj', {
hello: 'world'
}));
````
```

Will result in:

````
```json
{
"hello": "world"
}
````
```

It also supports template strings:

```javascript
esprintf`%.2${42.4242}f`;
```

Will result in:

`42.42`

0 comments on commit 2d08bd2

Please sign in to comment.