mirror of
https://github.com/samsonjs/format.git
synced 2026-03-25 08:45:53 +00:00
update readme
This commit is contained in:
parent
1bc06f0f15
commit
5e05fc2925
1 changed files with 10 additions and 5 deletions
15
Readme.md
15
Readme.md
|
|
@ -15,9 +15,11 @@ or otherwise include them with your other JavaScript.
|
||||||
Usage
|
Usage
|
||||||
=====
|
=====
|
||||||
|
|
||||||
var Format = require('format')
|
var format = require('format')
|
||||||
, printf = Format.printf
|
, printf = format.printf
|
||||||
, format = Format.format // aliased as sprintf as well
|
, vsprintf = format.vsprintf
|
||||||
|
// or if you want to keep it old school
|
||||||
|
, sprintf = format
|
||||||
|
|
||||||
// Print 'hello world'
|
// Print 'hello world'
|
||||||
printf('%s world', 'hello')
|
printf('%s world', 'hello')
|
||||||
|
|
@ -26,6 +28,9 @@ Usage
|
||||||
format('%d is the answer to %s', 42, what)
|
format('%d is the answer to %s', 42, what)
|
||||||
// => '42 is the answer to life, the universe, and everything'
|
// => '42 is the answer to life, the universe, and everything'
|
||||||
|
|
||||||
|
vsprintf('%d is the answer to %s', [42, what])
|
||||||
|
// => '42 is the answer to life, the universe, and everything'
|
||||||
|
|
||||||
Supported format specifiers: b, c, d, f, o, s, x, and X.
|
Supported format specifiers: b, c, d, f, o, s, x, and X.
|
||||||
|
|
||||||
See `man 3 printf` or `man 1 printf` for details.
|
See `man 3 printf` or `man 1 printf` for details.
|
||||||
|
|
@ -34,6 +39,6 @@ See `man 3 printf` or `man 1 printf` for details.
|
||||||
License
|
License
|
||||||
=======
|
=======
|
||||||
|
|
||||||
Copyright 2010 - 2011 Sami Samhuri sami@samhuri.net
|
Copyright 2010 - 2013 Sami Samhuri sami@samhuri.net
|
||||||
|
|
||||||
ISC (see included [LICENSE](/samsonjs/format/blob/master/LICENSE))
|
ISC (like MIT) (see included [LICENSE](/samsonjs/format/blob/master/LICENSE))
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue