{"name":"stream-template","version":"0.0.7","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","precommit":"lint-staged"},"lint-staged":{"*.{js,json,css,md}":["prettier --write","git add"]},"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","husky":"^0.14.3","lint-staged":"^7.2.0"},"dependencies":{"end-of-stream":"^1.4.1","readable-stream":"^2.1.5"},"engines":{"node":">=4.0.0"},"gitHead":"9c54a38f0c54ee912b4c48db4a96c3cbe24edb00","homepage":"https://github.com/almost/stream-template#readme","_id":"stream-template@0.0.7","_npmVersion":"5.1.0","_nodeVersion":"8.9.4","_npmUser":{"name":"almost","email":"tom@almostobsolete.net"},"dist":{"integrity":"sha512-yb49NIox+8pVaoV+MVCd5RXZYNRKe7h1HRrBXCwlXcTEkifuDnFCjzF3R2Y1LLwWFBEHxIURjstzIBM/RJKTyA==","shasum":"1369fb89a767ba441e9f3fec50088e287951a5ee","tarball":"http://registry-npm.ywwl.com/stream-template/download/stream-template-0.0.7.tgz","fileCount":4,"unpackedSize":9283,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbHjkXCRA9TVsSAnZWagAAa4cP/Rs+EfZODgv7o7KPhFea\ngQ4AYqFrXDnj7ZjY7Ee0PkmTyhaZ4rxpolMHJJq/ghKBnL/z052lAUEW5y0l\n6XAcI6QJq1npg8lsurcPehLlKtdfNjA22YluKKz0Sluv3sRmKIHunR8ropYd\nQHp/CHD3PK5c6RQfF7Oj0P3KjHX8m/HD8/LLpCPVXQN3TkCmt/68CvqvquCO\nJDLZBtLCcPCiiaIoCahS115HMnTnYC2+Yvn869YruRqDY7f020VzqmfaRj4u\nnosds5TbFNPjvi3kzyB+zBiHqhDsaiWC4LCb+bk9PZYKmlA4pwlWFUqBqyni\n9aKnEjgm+svj8D3FhewKgAXdUEg1blZ0+XaUFNxZnLs4q9lXNupenifu1e7H\n9pyilFNaB/SMdZGRmskc2mJYSEBGHDkpu5GlMusTFMqmPwkGbIpFff9qgko6\nIx3esio9URHhtFBUuRSb6D/nCrm6l0grh8bd1JAtS4OH6VRKiWYojKpQu47H\nyJOWdZNE8psEYoo43FZBMbnUNP/EnPF1O1rWT7Jpck3+xeyw+fgrnkvBINUq\nCsNNtPKtKXlHePa5F2huacHGjEB1hZK5JuywOkRFGlh7npCOr0GizdILkK0b\ngXTzVwBGpCNCU1jN+XslXGaBokcOV5JN+QxqBdwvykLOvxGtAOnmwCGgZahQ\ne4sP\r\n=viMD\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAkemvnStlCuzdtfxm6jsmzHO54hPvuYfSMFmxYfxKYlAiBQvUFoIcLr2xjN7aSyMJFwqedBpmJYjJb2OKkLWIUPBg=="}],"size":3580,"noattachment":false,"key":"/stream-template/-/stream-template-0.0.7.tgz"},"maintainers":[{"name":"almost","email":"tom@almostobsolete.net"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/stream-template_0.0.7_1528707350747_0.6643130080815784"},"_hasShrinkwrap":false,"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":1528707350858,"_cnpm_publish_time":1528707350858,"dist-tags":{"latest":"0.0.10"}}