JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 19
  • Score
    100M100P100Q53957F
  • License MIT

No-frills string interpolation library.

Package Exports

  • spice

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (spice) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Spice

No-frills string interpolation library.

var spice = require('spice')
spice('Hello, {:subject}!', { subject: 'world' })
// => (string) "Hello, world!"

Or, alternatively, mess with the String#prototype:

var spice = require('spice')
String.prototype.format = function(mappings) {
  return spice(this, mappings)
}

'Hello, {:subject}!'.format({
  subject: 'world'
})
// => (string) "Hello, world!"

Installing

Just grab it from NPM for the easy-modo install:

$ npm install spice
# Then require it as usual
node> var spice = require('spice')

Testing

The test cases uses Mocha, Noire and Sinon. Just grab everything from NPM and run the test-cases by issuing mocha from the command line:

$ npm install         # If you haven't grabbed devDeps yet
$ npm run-script test

Licence

Spice is licensed under the delicious and permissive MIT licence. You can happily copy, share, modify, sell or whatever — refer to the actual licence text for less information:

$ less LICENCE