extsprintf
Advanced tools
Comparing version 1.2.1 to 1.3.0
@@ -13,2 +13,3 @@ /* | ||
exports.printf = jsPrintf; | ||
exports.fprintf = jsFprintf; | ||
@@ -138,5 +139,11 @@ /* | ||
var args = Array.prototype.slice.call(arguments); | ||
process.stdout.write(jsSprintf.apply(this, args)); | ||
args.unshift(process.stdout); | ||
jsFprintf.apply(null, args); | ||
} | ||
function jsFprintf(stream) { | ||
var args = Array.prototype.slice.call(arguments, 1); | ||
return (stream.write(jsSprintf.apply(this, args))); | ||
} | ||
function doPad(chr, width, left, str) | ||
@@ -143,0 +150,0 @@ { |
{ | ||
"name": "extsprintf", | ||
"version": "1.2.1", | ||
"version": "1.3.0", | ||
"description": "extended POSIX-style sprintf", | ||
@@ -5,0 +5,0 @@ "main": "./lib/extsprintf.js", |
@@ -40,1 +40,8 @@ # extsprintf: extended POSIX-style sprintf | ||
hello world | ||
# Also supported | ||
**printf**: same args as sprintf, but prints the result to stdout | ||
**fprintf**: same args as sprintf, preceded by a Node stream. Prints the result | ||
to the given stream. |
Sorry, the diff of this file is not supported yet
22806
151
47