sprint is implementation of
sprintf function from C++. If it is ran in
Node.js envirnoment then it's used as module, otherwise module inserts
sprint() function into global object (usually
// Node.js var sprint = require('sprint'); // Will return "b a" console.log(sprint('%2$s %1$s', 'a', 'b'));
All standard format placeholders are supported with the exception of
In addition, following non-standard features are supported:
n$- number of the parameter allowing the parameters to be used multiple times or displayed in different order. It's not in C99, but it's POSIX entension, so support for it is already common.
%B- a binary number
%O- practially their uppercase variants. Inserted in this list just because of their usage in Perl's
%v- vectors (from Perl implementation of
For more information, read documentation of
sprintf() in other programming
If certain feature doesn't exist and you think it should exist, feel free to make issue about it. Unless it's impossible to implement it, you can expect it in next major release.
And last thing before I will end this
README file, have fun!