{"name":"stream-template","version":"0.0.10","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.6.2","expect.js":"^0.3.1","husky":"^0.14.3","lint-staged":"^7.2.0","mocha":"^2.2.1","prettier":"^1.13.5"},"dependencies":{"end-of-stream":"^1.4.1","readable-stream":"^2.3.6"},"engines":{"node":">=4.0.0"},"gitHead":"ebe4724c6a825588852dc5715cc26122316883cc","homepage":"https://github.com/almost/stream-template#readme","_id":"stream-template@0.0.10","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"almost","email":"tom@almostobsolete.net"},"dist":{"integrity":"sha512-whIqf/ljJ88dr0z6iNFtJq09rs4R6JxJOnIqGthC3rHFEMYq6ssm4sPYILXEPrFYncMjF39An6MBys1o5BC19w==","shasum":"d04a78a428c90f44c4e0a8e7403cf70946bdcd97","tarball":"http://registry-npm.ywwl.com/stream-template/download/stream-template-0.0.10.tgz","fileCount":4,"unpackedSize":9803,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbbZIACRA9TVsSAnZWagAAoaUP/0Fp8qQjfCpZyKFBHl7d\nGvmS/5zMNyZbWuxEjMy6fbeOBHDarJJO988fcwt46QhhbZKv6QIe9e88MHLY\n2m14MWd0EubEjNZqCm4VjkVf18mfuR+U/4nYMkMRxa/7iKKVB+CYk3CEBcHY\nwi5YIjFxn3b0hGZGv8hEIS0E2M3b8SeIweEICP64P6ci39th+a8S69GEwx96\nHYfB2rutcI3h3uwj+kvwFq/sVHshTDXs6leialnsA05tdpGcBSP8ZczEB/MM\nH1e75nXBgCZqkpARyXlaE/UamZn6xOH9+6dHeKweFYBzAXBXjEZe4Cp/n1yt\n3rX2QoBg1LCpBhOXhvFnlAifg+GX2ZDXJ4D8BE/xPyHpv6pQ/Ebe6IsOk9d/\nzIdPPAnbKqUzLGJ81jWYuUzAqiUC7wb+a5oUzJv3Hgwra18h727jjOzQAO7N\nyn6O23KLRu2NEwj35Aa8y20fPO0zJmK+BJrC3i9OKMXnFjL4J73YGS8BthAV\nfvs6pAi7lgL9EkCuoCIlVnGtFR+aaFztJy13j+PiKOoCq8IfEp6e2SbWi4Ti\nSnfvrgV+oE64EVYBV74oQKHh6DPrmHDqBuWM+9iUKWMTlT2D+S2c4Ja1w9gH\nO2Ppuyv/a18euxoRNqdupQ/iNWfSIi4mbfP32fzqjwbRACN1babSD3YXQktS\nuZle\r\n=4ka7\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIG+N37ELNvf0kFjYybvLT5MlS9Afg2cCcVzbwxfRhf3XAiEA2Z5bVfZMNDhmTu2dhijjutkfrj/puGJj1B9quxaSFuw="}],"size":3676,"noattachment":false,"key":"/stream-template/-/stream-template-0.0.10.tgz"},"maintainers":[{"name":"almost","email":"tom@almostobsolete.net"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/stream-template_0.0.10_1533907456390_0.15762072358880452"},"_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":1533907456483,"_cnpm_publish_time":1533907456483,"dist-tags":{"latest":"0.0.10"}}