{"name":"stream-template","version":"0.0.9","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":"912b74e85a27f507b93d69dbf25240f0ebc3e043","homepage":"https://github.com/almost/stream-template#readme","_id":"stream-template@0.0.9","_npmVersion":"5.1.0","_nodeVersion":"8.9.4","_npmUser":{"name":"almost","email":"tom@almostobsolete.net"},"dist":{"integrity":"sha512-BvmOJhj6wtuKr6nH8EZg0GG8gZd7g8ar/h4TNhW6nxk7Uf8Lid3cRVF9nZmdbEuGXWOfk4Pge/AA2iZQOIcVZA==","shasum":"0467fbaa2f9026fa986659871d4d8a7531fca045","tarball":"http://registry-npm.ywwl.com/stream-template/download/stream-template-0.0.9.tgz","fileCount":4,"unpackedSize":9485,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbIULGCRA9TVsSAnZWagAAY4cP/RLR5ULw7x4l7n6bSh/k\nvP7p2mWumqQHx2dbnU3QvbFAFTUhMAf1bAfWtLtQVa4hQ/3qHkxeX/kkJG5F\nNRmPAIV3xGkZjGROnprb+C2l7/p3RrC/5QCHVpO1QmnXZ8soqqaOmMi24xOX\nFwqNWVR3dxuj+OPw2WqPzR24KdNrL/7bLQkOOj03hHLSSQCC9tJEFrSWlERw\nKE42Vr8BqaiX4G+VrhaOf5bknYiDJo4ahqjPxyIDlqlCc7N83TBIjma4uoeT\niks0VxEyZWOp56O0fxwguKqPNU1Zm+B7PYHBh0rM/5yi0qBKkkEK/Jl2VvlU\nsVu6eFoYjGrCEUaG/gJrTT9Uwc+4aW7ZtlBqfD6gesmkJ4AKuh8t6Dj1Fd+o\nkB386pZuUqqyDUkFMcCn3N8KbWyhKIZDyqP6Dm99AZPOrluBEf+o2nVC9tlV\nrxW6Z6LTzd04ynVc2n68mptzNYByhgEwrZV8IZSh3C0HDNYs82p08mJDtiIR\nOdyHLT+Ws1i57JAPj53ZMOFV59CPKGqiVo6jQbNDVEwwfUSHEPF4Z8B8c+XY\nMYBBF9095mAZRcFWXbSVcS9vF+SPbzuoHOy5er07VbcJiT8Rh39131rFmjJR\nLMeSzYBfZ+YrK79sal51vVGzTrtMISxNNtuRMOxcSl1MDpJ+p0he0bxZorZ9\nJ0hD\r\n=L/l7\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCkb6Qrbz9kxeSC3TLUk7KxenckrUgdRJT4j6lNk7v6owIhAPwSSyjc+fkZwVTc6+BTBUq47RDuSO4HJ/apoxJTdiAl"}],"size":3621,"noattachment":false,"key":"/stream-template/-/stream-template-0.0.9.tgz"},"maintainers":[{"name":"almost","email":"tom@almostobsolete.net"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/stream-template_0.0.9_1528906435667_0.9620856019910895"},"_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":1528906435724,"_cnpm_publish_time":1528906435724,"dist-tags":{"latest":"0.0.10"}}