jformat
Python function str.format for JavaScript
Last updated 2 years ago by tiagodanin .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install jformat 
SYNC missed versions from official npm registry.

JFormat

Node Version Downloads Travis

Python function str.format for JavaScript

Installation

Module available through the npm registry. It can be installed using the npm or yarn command line tools.

# NPM
npm install jformat --save
# Or Using Yarn
yarn add jformat

Example

"Forever {Python}".format({Python: "JavaScript"});
// "Forever JavaScript"

"Forever {0}".format(["JavaScript"]);
// "Forever JavaScript"

"Forever {Java}".format({}, true);
// "Forever "

format("Forever {Python}", {Python: "JavaScript"});
// "Forever JavaScript"

format("Forever {0}", ["JavaScript"]);
// "Forever JavaScript"

format("Forever {Java}", {}, true);
// "Forever "

Documentation

format(string, table, HideIfNull)

Options

  • string

Type: string

  • table

Type: array & object

  • HideIfNull

Type: boolean

Tests

To run the test suite, first install the dependencies, then run test:

# NPM
npm test
# Or Using Yarn
yarn test

Dependencies

None

Contributors

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue. List of all contributors.

License

MIT © TiagoDanin

Current Tags

  • 1.1.0                                ...           latest (2 years ago)

6 Versions

  • 1.1.0                                ...           2 years ago
  • 1.0.4                                ...           3 years ago
  • 1.0.3                                ...           3 years ago
  • 1.0.2                                ...           3 years ago
  • 1.0.1                                ...           3 years ago
  • 1.0.0                                ...           3 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 2
Last Day 0
Last Week 0
Last Month 0
Dependencies (0)
None
Dev Dependencies (0)
None
Dependents (3)

Copyright 2014 - 2016 © taobao.org |