{"name":"string-template","version":"0.2.1","description":"A simple string template function based on named or indexed arguments","keywords":["template","string","format","replace","arguments"],"author":{"name":"Matt-Esch","email":"matt@mattesch.info"},"repository":{"type":"git","url":"git://github.com/Matt-Esch/string-template.git"},"main":"index","homepage":"https://github.com/Matt-Esch/string-template","contributors":[{"name":"Matt-Esch"}],"bugs":{"url":"https://github.com/Matt-Esch/string-template/issues","email":"matt@mattesch.info"},"dependencies":{},"devDependencies":{"tape":"~1.1.1"},"licenses":[{"type":"MIT","url":"http://github.com/Matt-Esch/string-template/raw/master/LICENSE"}],"scripts":{"test":"node ./test/index.js","travis-test":"istanbul cover ./test/index.js && ((cat coverage/lcov.info | coveralls) || exit 0)","cover":"istanbul cover --report none --print detail ./test/index.js","view-cover":"istanbul report html && google-chrome ./coverage/index.html"},"testling":{"files":"test/index.js","browsers":["ie/8..latest","firefox/16..latest","firefox/nightly","chrome/22..latest","chrome/canary","opera/12..latest","opera/next","safari/5.1..latest","ipad/6.0..latest","iphone/6.0..latest","android-browser/4.2..latest"]},"readme":"# string-template\n\n[![build status][1]][2] [![dependency status][3]][4] [![coverage report][9]][10] [![stability index][15]][16]\n\n[![npm stats][13]][14]\n\n[![browser support][5]][6]\n\n  A simple string template function based on named or indexed arguments\n\n## Example\n\n```js\nvar format = require(\"string-template\")\nvar greeting\n\n// Format using an object hash with keys matching [0-9a-zA-Z]+\n\ngreeting = format(\"Hello {name}, you have {count} unread messages\", {\n    name: \"Robert\",\n    count: 12\n})\n// greeting -> \"Hello Robert, you have 12 unread messages\"\n\n\n// Format using a number indexed array\n\ngreeting = format(\"Hello {0}, you have {1} unread messages\", [\"Robert\", 12])\n// greeting -> \"Hello Robert, you have 12 unread messages\"\n\n\n// Format using optional arguments\n\ngreeting = format(\"Hello {0}, you have {1} unread messages\",\n     \"Robert\",\n     12)\n// greeting -> \"Hello Robert, you have 12 unread messages\"\n\n\n// Escape {} pairs by using double {{}}\n\nvar text = format(\"{{0}}\")\n// text -> \"{0}\"\n\n```\n\n## Compiling templates\n\n`string-template` exposes two template compiling options for when you need the\nadditional performance. Arguments passed to the compiled template are of the\nsame structure as the main `string-template` function, so either a single\nobject/array or a list of arguments.\n\n```js\nvar compile = require(\"string-template/compile\")\n\nvar greetingTemplate = compile(\"Hello {0}, you have {1} unread messages\")\n\nvar greeting = greetingTemplate(\"Robert\", 12)\n// -> \"Hello Robert, you have 12 unread messages\"\n```\n\nPassing a truthy second argument to `compile` will opt into using `new Function`\nto generate a function. The function returned contains a literal string\nconcatenation statement, interleaving the correct arguments you have passed in.\n\n```js\nvar compile = require(\"string-template/compile\")\n\nvar greetingTemplate = compile(\"Hello {0}, you have {1} unread messages\", true)\n// -> greetingTemplate generated using new Function\n\nvar greeting = greetingTemplate([\"Robert\", 12])\n// -> \"Hello Robert, you have 12 unread messages\"\n```\n\n## Installation\n\n`npm install string-template`\n\n## Contributors\n\n - Matt-Esch\n\n## MIT Licenced\n\n  [1]: https://secure.travis-ci.org/Matt-Esch/string-template.png\n  [2]: https://travis-ci.org/Matt-Esch/string-template\n  [3]: https://david-dm.org/Matt-Esch/string-template.png\n  [4]: https://david-dm.org/Matt-Esch/string-template\n  [5]: https://ci.testling.com/Matt-Esch/string-template.png\n  [6]: https://ci.testling.com/Matt-Esch/string-template\n  [9]: https://coveralls.io/repos/Matt-Esch/string-template/badge.png\n  [10]: https://coveralls.io/r/Matt-Esch/string-template\n  [13]: https://nodei.co/npm/string-template.png?downloads=true&stars=true\n  [14]: https://nodei.co/npm/string-template\n  [15]: http://hughsk.github.io/stability-badges/dist/unstable.svg\n  [16]: http://github.com/hughsk/stability-badges\n\n  [7]: https://badge.fury.io/js/string-template.png\n  [8]: https://badge.fury.io/js/string-template\n  [11]: https://gemnasium.com/Matt-Esch/string-template.png\n  [12]: https://gemnasium.com/Matt-Esch/string-template\n","readmeFilename":"Readme.md","_id":"string-template@0.2.1","_shasum":"42932e598a352d01fc22ec3367d9d84eec6c9add","_from":"https://registry.npmjs.org/string-template/-/string-template-0.2.1.tgz","_resolved":"https://registry.npmjs.org/string-template/-/string-template-0.2.1.tgz"}