source: node_modules/format/Readme.md

main
Last change on this file was d24f17c, checked in by Aleksandar Panovski <apano77@…>, 15 months ago

Initial commit

  • Property mode set to 100644
File size: 1.0 KB
Line 
1format
2======
3
4printf, sprintf, and vsprintf for JavaScript
5
6
7Installation
8============
9
10npm install format
11
12The code works in browsers as well, you can copy these functions into your project
13or otherwise include them with your other JavaScript.
14
15Usage
16=====
17
18 var format = require('format')
19 , printf = format.printf
20 , vsprintf = format.vsprintf
21 // or if you want to keep it old school
22 , sprintf = format
23
24 // Print 'hello world'
25 printf('%s world', 'hello')
26
27 var what = 'life, the universe, and everything'
28 format('%d is the answer to %s', 42, what)
29 // => '42 is the answer to life, the universe, and everything'
30
31 vsprintf('%d is the answer to %s', [42, what])
32 // => '42 is the answer to life, the universe, and everything'
33
34Supported format specifiers: b, c, d, f, o, s, x, and X.
35
36See `man 3 printf` or `man 1 printf` for details.
37
38Precision is supported for floating point numbers.
39
40License
41=======
42
43Copyright 2010 - 2014 Sami Samhuri sami@samhuri.net
44
45[MIT license](http://sjs.mit-license.org)
46
Note: See TracBrowser for help on using the repository browser.