GitXplorerGitXplorer
y

fmt

public
39 stars
7 forks
0 issues

Commits

List of commits on branch master.
Unverified
f48166936f66ec477694c8e2a49346498a64732e

simplify toString

yyields committed 10 years ago
Unverified
739698eeb0bb6b04f3f5718f2eb93481da3bbc72

Release 0.1.0

yyields committed 10 years ago
Unverified
dcc02e8aea7c98ac2f105bcbf88dc31753c28875

add JSON.stringify fallback

yyields committed 10 years ago
Unverified
44a67b6dd50adb3e3243bd04f09c5fc1d2fe5a85

Merge pull request #1 from stephenmathieson/master

yyields committed 10 years ago
Unverified
1f54bcecdb7b27caf8c1b6cfafb52fd5fc885517

test: Fix extensible assertion

committed 10 years ago
Unverified
988cefd59c805b7753e416756f3a4dc31ecc4853

Release 0.0.2

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