{"name":"stream-template","version":"0.0.8","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"},"dependencies":{"end-of-stream":"^1.4.1","readable-stream":"^2.3.6"},"engines":{"node":">=4.0.0"},"gitHead":"b77041852bb9f574b7b6a22a397976a96dd53407","homepage":"https://github.com/almost/stream-template#readme","_id":"stream-template@0.0.8","_npmVersion":"5.1.0","_nodeVersion":"8.9.4","_npmUser":{"name":"almost","email":"tom@almostobsolete.net"},"dist":{"integrity":"sha512-n2fdx5Q27MN875zZOWGq6KrPRfcvLRq9+oyxYiOXxdAmhgpzByx/MKufiMIvwKnCW2HsQkge3ljNk1drL1fYDQ==","shasum":"ba7b01baff8ced0b4f5e322d4f8e5f804204fd98","tarball":"http://registry-npm.ywwl.com/stream-template/download/stream-template-0.0.8.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\nwsFcBAEBCAAQBQJbHjuHCRA9TVsSAnZWagAAnp0P/3zanaZMMfdWq8yFMKe5\nvWzuhxqUDUzHvAclT6twZDOeBZcki3ClE/wfCqsJswRerCtKtuqm5w0EJjKf\niiW3qbHqwHrqTAAYF49U9jCt1MiTxg85zM5whTzaF+X2akWSRAODez/upZQU\nzmcTyInQ46X6DKRQgJ5UGMSwxcRloRZI+X/CX9QhM0EXlDe/KMA8DPdKnBpQ\n9tL3pUui5Oz5R8S86cp8Pj322AwSDxP6vWa5aR6CpvK2JzD6VbDKuT6LcjiH\nu4RR8O+k2LzYdvqzvXxHtYLKomBz/2B2ZR5SqbfX7sgRcF+b249uPsJFv+Rw\nN/p6jV/jZF5izCzonuDcZxiUHVqFcWKPImCqIfybLwYdHUMgqVfeHbukRzEI\nTb/s5j7PNTtOq2OKL1omU9q0gwNPMTJZTQquqYRHSdTmOA02Ifmn7253rd5c\nb3irbccRBZDUI/t3WaVr62DYn9Io8BIBflrxLxUC5M57GUNXx5H3kTK9nuTZ\nnbVwYHbDd9OU3OJm1+mYrcx1vQ99MUOuASxSaS1i3wVKgeEhRmua8gcb4vAi\nigHxQsdzBuB0WY4Jx5uVag2gOTGcklPw6tFBNu4CYPRgtT6hFC/lB8AHIRfX\nO/nsWvRzXXJzASfauEjPvHM4VY7Gc+VPxCWQkPE6ghuPltjJiP5cJRgRnfe7\nwnZ2\r\n=H5IE\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCID7mjNKjBsZfDydHgk05UI821ILLksVOyLDgT/lgttnZAiEAsbWPXkmb87JQu7x7WGx7TjaO07bL6ZJTgBwRAh/Kbuc="}],"size":3582,"noattachment":false,"key":"/stream-template/-/stream-template-0.0.8.tgz"},"maintainers":[{"name":"almost","email":"tom@almostobsolete.net"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/stream-template_0.0.8_1528707975373_0.6604237226767633"},"_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":1528707975459,"_cnpm_publish_time":1528707975459,"dist-tags":{"latest":"0.0.10"}}