string format utility
Install with component(1):
$ component install yields/fmt
fmt('%d %s %o', '0n', 'str', {});
// => "0 str {}"
fmt.f = function(n){
return Number(n || 0).toFixed(2);
};
fmt('floats: %f', 1);
// => "floats: 1.00"
Format the given str
with ...
args.
- `%o`: JSON.stringify
- `%d`: parseInt
- `%s`: String
MIT