{"name":"stream-template","version":"0.0.4","description":"An ES6 Tagged String Literal tag that can interpolate Node.JS streams, strings, arrays and Promises and produces a stream.,","main":"stream-template.js","files":["stream-template.js"],"scripts":{"test":"mocha tests.js"},"repository":{"type":"git","url":"git+https://github.com/almost/stream-template.git"},"keywords":["streams","stream","streaming","streams2","template","taggedliteral","literal","string","es6","templating"],"author":{"name":"Thomas Parslow","email":"tom@almostobsolete.net","url":"http://almostobsolete.net/"},"license":"MIT","bugs":{"url":"https://github.com/almost/stream-template/issues"},"devDependencies":{"concat-stream":"^1.5.2","expect.js":"^0.3.1","mocha":"^2.2.1"},"dependencies":{"readable-stream":"^2.1.5"},"engines":{"node":">=4.0.0"},"gitHead":"acbbda96bb93a03ee943b0490c68c96261a14f61","homepage":"https://github.com/almost/stream-template#readme","_id":"stream-template@0.0.4","_shasum":"4bfc6eecdfa7a340dc40cd02c4c20d6ccbce942b","_from":".","_npmVersion":"3.10.9","_nodeVersion":"7.1.0","_npmUser":{"name":"almost","email":"tom@almostobsolete.net"},"maintainers":[{"name":"almost","email":"tom@almostobsolete.net"}],"dist":{"shasum":"4bfc6eecdfa7a340dc40cd02c4c20d6ccbce942b","tarball":"http://registry-npm.ywwl.com/stream-template/download/stream-template-0.0.4.tgz","integrity":"sha512-B5itgQpFlKedF57KzD+NP0Pk1a+ie1lztinkbDUolYYc4VIiIGERbBYXKTpBkCz3yNQT07hQe0epYKRAlC3uuQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD2/jUvxbxdeIgoGoy9DDzq1t0++k8ogkjlySTcbLjLmAIhALOKdLROvZI0nOQ3pC7XSGkayqilzPmRmvuwWX8/nd+U"}],"size":3312,"noattachment":false,"key":"/stream-template/-/stream-template-0.0.4.tgz"},"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/stream-template-0.0.4.tgz_1479729760148_0.2301040394231677"},"directories":{},"readme":"# stream-template\n\nAn ES6/ES2015 [Tagged String\nLiteral](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Template_literals#Tagged_template_literals)\ntag that can interpolate Node.JS streams, strings and Promises that return\neither (or arrays of any of those) and produces a Node.JS stream. This allows\nyou to join several Streams together with bits in between without having to\nbuffer anything.\n\nWritten by Thomas Parslow ([almostobsolete.net](http://almostobsolete.net) and\n[tomparslow.co.uk](http://tomparslow.co.uk)) for IORad\n([iorad.com](http://iorad.com/)) and released with their kind permission.\n\n[![NPM](https://nodei.co/npm/stream-template.png?downloads&downloadRank)](https://nodei.co/npm/stream-template/)\n\n[![Build Status](https://travis-ci.org/almost/stream-template.svg)](https://travis-ci.org/almost/stream-template)\n\nWarning: will only run on newer versions of Node.JS (tested on 4.0.0 and above)\n\n## Install\n\n```bash\nnpm install --save stream-template\n```\n\n## Examples\n\n```javascript\nconst ST = require(\"stream-template\");\n\nconst data1 = fs.createReadStream(\"data1.txt\");\nconst data2 = fs.createReadStream(\"data2.txt\");\nconst output = ST`<html>\n  1: <pre>${data1}</pre>\n  2: <pre>${data2}</pre>\n</html>`;\noutput.pipe(process.stdout);\n```\n\nCan also accept arrays (items are concatenated, array items can be any of the\nsupported types):\n\n```javascript\nconst ST = require(\"stream-template\");\n\nconst data = [\n  fs.createReadStream(\"part1.txt\"),\n  fs.createReadStream(\"part2.txt\")\n];\nconst output = ST`Data follows: ${data}`;\noutput.pipe(process.stdout);\n```\n\nAnd also Promises:\n\n```javascript\nconst ST = require(\"./stream-template\");\nconst fetch = require(\"node-fetch\");\n\nconst email = fetch(\"https://api.github.com/users/almost\")\n  .then(r => r.json())\n  .then(profile => {\n    return profile.email;\n  });\n\nconst output = ST`<a href=\"mailto:${email}\">Email</a>`;\noutput.pipe(process.stdout);\n```\n\nAnd of course regular strings work:\n\n```javascript\nconst output = ST`Hello by name is ${name}`;\noutput.pipe(process.stdout);\n```\n\nI've shown each used seperated but you can do it all mixed together as well.\n\n## Encoding\n\nBy default strings are encoded as utf-8, you can change the encoding like this:\n\n```javascript\nconst ST = require(\"stream-template\").encoding(\"utf16le\");\n```\n\nNote that buffers and other streams are passed through as-is, the encoding only\neffects the template strings and interpolated strings.\n\n## Contributing\n\nFixed or improved stuff? Great! Send me a pull request [through GitHub](http://github.com/almost/stream-template)\nor get in touch on Twitter [@almostobsolete](https://twitter.com/almostobsolete) or email at tom@almostobsolete.net\n","publish_time":1479729760673,"_cnpm_publish_time":1479729760673,"dist-tags":{"latest":"0.0.10"}}