Complex sprintf() implementation
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
var sprint = require'sprint'sprint;// Will return "b a"console.logsprint'%2$s %1$s' 'a' 'b';
All standard format placeholders are supported with the exception of
In addition, following not 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 lowercase variants. Inserted in this list just because of their usage in Perl's
For more information, read documentation of sprintf() in other programming languages.