Is there a sprintf equivalent for node.js


Question

Looking to do output formatting (sprintf type functionality) in node.js, but before I write it myself I was wondering if there's something similar built-in (I've trawled the docs to no avail) or if someone's already written a module.

Many thanks

1
65
4/28/2010 7:54:17 AM

There is now printf-like support in util.format().

Example:

util.format('hello %s', 'world');
// Returns: 'hello world'
64
4/6/2017 1:01:50 AM

Licensed under: CC-BY-SA with attribution
Not affiliated with: Stack Overflow
Icon