GitXplorerGitXplorer
y

fmt

public
39 stars
7 forks
0 issues

Commits

List of commits on branch master.
Unverified
c2a4ae95df431cddd399e48e7771451946839521

dev deps

yyields committed 11 years ago
Unverified
81fdbe9706922c6b77cbeb1bddf803432d084b6a

Release 0.0.1

yyields committed 11 years ago
Unverified
41db2d86201b99864bb48a45ffdd1bec9b18f065

Initial commit

yyields committed 11 years ago

README

The README file for this repository.

fmt

string format utility

Installation

Install with component(1):

$ component install yields/fmt

Example

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"

API

fmt(str, ...)

Format the given str with ... args.

- `%o`: JSON.stringify
- `%d`: parseInt
- `%s`: String

License

MIT