{"name":"string-template","version":"1.0.0","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":{"istanbul":"^0.4.1","opn":"^3.0.3","tape":"~1.1.1"},"license":"MIT","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 && opn --no-wait ./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"]},"gitHead":"1a936280d4c9569035f9ac6a9808df564d413b30","_id":"string-template@1.0.0","_shasum":"9e9f2233dc00f218718ec379a28a5673ecca8b96","_from":".","_npmVersion":"2.11.3","_nodeVersion":"0.10.32","_npmUser":{"name":"mattesch","email":"matt@mattesch.info"},"dist":{"shasum":"9e9f2233dc00f218718ec379a28a5673ecca8b96","tarball":"http://registry-npm.ywwl.com/string-template/download/string-template-1.0.0.tgz","integrity":"sha512-SLqR3GBUXuoPP5MmYtD7ompvXiG87QjT6lzOszyXjTM86Uu7At7vNnt2xgyTLq5o9T4IxTYFyGxcULqpsmsfdg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIH84iWSJXcVTL1T7TMP4aZvxVsypk5ZfIviBK9sBw4PhAiEAgOi8IM7viyQps9JXF1HvxbgIfTV7hiGeTg4pUR9Dl1Q="}],"size":20438,"noattachment":false,"key":"/string-template/-/string-template-1.0.0.tgz"},"maintainers":[{"name":"mattesch","email":"matt@mattesch.info"}],"directories":{},"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","publish_time":1452196395770,"_cnpm_publish_time":1452196395770,"dist-tags":{"latest":"1.0.0"}}