From 3dc49ce826aae96ac32a197a6465d403d4c5799a Mon Sep 17 00:00:00 2001 From: Jan Pieper Date: Sun, 29 May 2011 01:02:44 -0700 Subject: [PATCH] vsprintf --- lib/index.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/index.js b/lib/index.js index 8047c12..614e335 100644 --- a/lib/index.js +++ b/lib/index.js @@ -74,4 +74,13 @@ exports.format = function(format) { } return result; }; + +exports.vsprintf = function(format, replacements) { + var args = [format]; + replacements.forEach(function(replacement) { + args.push(replacement); + }); + return exports.format.apply(this, args); +}; + exports.sprintf = exports.format;