是否有一个sprintf等效于node.js
想在node.js中做输出格式化(sprintftypes的function),但在我自己写之前,我想知道是否有类似的内置(我拖过文档无济于事),或者如果有人已经写了一个模块。
非常感谢
 util.format()现在有util.format() printf的支持。 
例:
 util.format('hello %s', 'world'); // Returns: 'hello world' 
在npmregistry中有几个:
- 的sprintf(现已弃用)
- 的sprintf JS
 这里是sprintf的JavaScript版本: 
  console.log工作正常。 
 console.log('%d hours', 4); // 4 hours console.log('The %2$s contains %1$d monkeys', 4, 'tree'); // The tree contains 4 monkeys