{"_id":"spawn-to-readstream","_rev":"17-a878d4a2b4aa1227c99bceaf47be3aeb","name":"spawn-to-readstream","description":"Converts spawn to a ReadStream, buffers the error and emits it","dist-tags":{"latest":"0.1.3"},"versions":{"0.0.1":{"author":{"name":"Alexandru Vladutu","email":"alexandru.vladutu@gmail.com"},"license":"MIT","name":"spawn-to-readstream","description":"Converts spawn to a ReadStream, buffers the error and emits it","version":"0.0.1","repository":{"type":"git","url":"git://github.com/alessioalex/spawn-to-readstream.git"},"main":"index.js","engines":{"node":">= 0.4.0"},"keywords":["buffer-spawn-error","error","spawn","spawn-error"],"dependencies":{"through":"2.3.x"},"devDependencies":{"tap":"0.4.x"},"scripts":{"test":"node test/index.js"},"bugs":{"url":"https://github.com/alessioalex/spawn-to-readstream/issues"},"_id":"spawn-to-readstream@0.0.1","dist":{"shasum":"31633e2d407e367b1a79506f031efeeb3096b43c","tarball":"https://registry.npmjs.org/spawn-to-readstream/-/spawn-to-readstream-0.0.1.tgz","integrity":"sha512-m1gGQHGOjE7i5e/eoqtE5oxL/VG0dNt+9f9/Ni03IQCaBsvzrE1ziXCgJctqB22kz7AQ971rjWMWOgAVifGJRw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD8NYiCz+hZT5Fv9VlIAuYZJ8Fokw7mZYOJI6jS8D7fngIgev2+fcvwDbF7Q96aWM4cOE6d1KPVEK+BdlDhU84/uvM="}]},"_from":".","_npmVersion":"1.2.32","_npmUser":{"name":"alessioalex","email":"alexandru.vladutu@gmail.com"},"maintainers":[{"name":"alessioalex","email":"alexandru.vladutu@gmail.com"}]},"0.1.0":{"author":{"name":"Alexandru Vladutu","email":"alexandru.vladutu@gmail.com"},"license":"MIT","name":"spawn-to-readstream","description":"Converts spawn to a ReadStream, buffers the error and emits it","version":"0.1.0","repository":{"type":"git","url":"git://github.com/alessioalex/spawn-to-readstream.git"},"main":"index.js","engines":{"node":">= 0.8.0"},"keywords":["buffer-spawn-error","error","spawn","limit","spawn-error"],"dependencies":{"through":"2.3.x","limit-spawn":"0.0.x"},"devDependencies":{"tap":"0.4.x"},"scripts":{"test":"node test/index.js"},"bugs":{"url":"https://github.com/alessioalex/spawn-to-readstream/issues"},"_id":"spawn-to-readstream@0.1.0","dist":{"shasum":"5e0d16acf6cc82450d0a65d56ed172172ea8cce4","tarball":"https://registry.npmjs.org/spawn-to-readstream/-/spawn-to-readstream-0.1.0.tgz","integrity":"sha512-S0CG+VBAIijfgG2DW9DLrbjs2zUedZS/alpmRZphkQ8b2KUa5FWxHByCAffL2xvVDMDF1nbWYA5RTEFHFi7SHA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIF3x/CmGYKBuv9GsNHCAjut6+vKsKbNTqAuCo6iNlPRmAiEAoZC6hJFHi16o5CiakIEosyXlBcA6uiszPMheSfEDJRo="}]},"_from":".","_npmVersion":"1.2.32","_npmUser":{"name":"alessioalex","email":"alexandru.vladutu@gmail.com"},"maintainers":[{"name":"alessioalex","email":"alexandru.vladutu@gmail.com"}]},"0.1.1":{"author":{"name":"Alexandru Vladutu","email":"alexandru.vladutu@gmail.com"},"license":"MIT","name":"spawn-to-readstream","description":"Converts spawn to a ReadStream, buffers the error and emits it","version":"0.1.1","repository":{"type":"git","url":"git://github.com/alessioalex/spawn-to-readstream.git"},"main":"index.js","engines":{"node":">= 0.8.0"},"keywords":["buffer-spawn-error","error","spawn","limit","spawn-error"],"dependencies":{"limit-spawn":"0.0.x","through2":"~0.4.1"},"devDependencies":{"tap":"0.4.x"},"scripts":{"test":"node test/index.js"},"bugs":{"url":"https://github.com/alessioalex/spawn-to-readstream/issues"},"homepage":"https://github.com/alessioalex/spawn-to-readstream","_id":"spawn-to-readstream@0.1.1","dist":{"shasum":"15ce161d267f3be41a7f608832263bce68404834","tarball":"https://registry.npmjs.org/spawn-to-readstream/-/spawn-to-readstream-0.1.1.tgz","integrity":"sha512-Gvh7/bPVuKI2jsY3C8/p2mb/KSxzhFQy5llr+lOVavVkcZBmO85/j2P+Ig/atlRdNuRiVFW7w/q4QjFuE1rDfg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGr1vsOQPZeCT/GMAhbi94qjzeWHycblOWWYdLoVQa5LAiAQV2Y8j0NC5WuMKh5cOwDv+9qASMKVIPbXEuEj0Zq+3w=="}]},"_from":".","_npmVersion":"1.3.14","_npmUser":{"name":"alessioalex","email":"alexandru.vladutu@gmail.com"},"maintainers":[{"name":"alessioalex","email":"alexandru.vladutu@gmail.com"}]},"0.1.2":{"author":{"name":"Alexandru Vladutu","email":"alexandru.vladutu@gmail.com"},"license":"MIT","name":"spawn-to-readstream","description":"Converts spawn to a ReadStream, buffers the error and emits it","version":"0.1.2","repository":{"type":"git","url":"git://github.com/alessioalex/spawn-to-readstream.git"},"main":"index.js","engines":{"node":">= 0.8.0"},"keywords":["buffer-spawn-error","error","spawn","limit","spawn-error"],"dependencies":{"limit-spawn":"0.0.3","through2":"~0.4.1"},"devDependencies":{"tap":"0.4.x"},"scripts":{"test":"node test/index.js"},"bugs":{"url":"https://github.com/alessioalex/spawn-to-readstream/issues"},"homepage":"https://github.com/alessioalex/spawn-to-readstream","_id":"spawn-to-readstream@0.1.2","dist":{"shasum":"61117d4d8368cafe8e6344bdd52f78e0a2314f81","tarball":"https://registry.npmjs.org/spawn-to-readstream/-/spawn-to-readstream-0.1.2.tgz","integrity":"sha512-jtMWQ7BRkyqWtaKEHNNRTOAAXeBPZoYqRaS6cpnUctJSLR/YQanwDHWSSucVAyWjeyVawhl00ZmwNiQMv1//eA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHjwZqtVOjUMlkQQ3hIYQFurH82Oe4on+AxT73TO4574AiA0w9oo4y8tXlHrHUl7aBzbmwDVr3XlUqmaAOLslHV8og=="}]},"_from":".","_npmVersion":"1.3.14","_npmUser":{"name":"alessioalex","email":"alexandru.vladutu@gmail.com"},"maintainers":[{"name":"alessioalex","email":"alexandru.vladutu@gmail.com"}]},"0.1.3":{"author":{"name":"Alexandru Vladutu","email":"alexandru.vladutu@gmail.com"},"license":"MIT","name":"spawn-to-readstream","description":"Converts spawn to a ReadStream, buffers the error and emits it","version":"0.1.3","repository":{"type":"git","url":"git://github.com/alessioalex/spawn-to-readstream.git"},"main":"index.js","engines":{"node":">= 0.8.0"},"keywords":["buffer-spawn-error","error","spawn","limit","spawn-error"],"dependencies":{"limit-spawn":"0.0.3","through2":"~0.4.1"},"devDependencies":{"tap":"0.4.x"},"scripts":{"test":"node test/index.js"},"bugs":{"url":"https://github.com/alessioalex/spawn-to-readstream/issues"},"homepage":"https://github.com/alessioalex/spawn-to-readstream","_id":"spawn-to-readstream@0.1.3","dist":{"shasum":"96768b72739ac64ffa77c8ce2cbf98c2d21d8dbf","tarball":"https://registry.npmjs.org/spawn-to-readstream/-/spawn-to-readstream-0.1.3.tgz","integrity":"sha512-Xxiqu2wU4nkLv8G+fiv9jT6HRTrz9D8Fajli9HQtqWlrgTwQ3DSs4ZztQbhN/HsVxJX5S7ynzmJ2lQiYDQSYmg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGh6ySZaKY4HE8k2C5UQxwXukKvx9/laTq+FKozGlU+6AiEAwkgpF7FgDyrE0MjnOTJUe4+XXpvMWQNU9OdQo9UFpWg="}]},"_from":".","_npmVersion":"1.3.14","_npmUser":{"name":"alessioalex","email":"alexandru.vladutu@gmail.com"},"maintainers":[{"name":"alessioalex","email":"alexandru.vladutu@gmail.com"}]}},"readme":"# spawn-to-readstream\r\n\r\n### Description\r\n\r\nMake child process spawn behave like a read stream (buffer the error, don't emit end if error emitted).\r\n\r\n### Installation\r\n\r\n```bash\r\nnpm install spawn-to-readstream\r\n```\r\n\r\n### Examples\r\n\r\n```js\r\nvar toReadStream = require('spawn-to-readstream'),\r\n    spawn        = require('child_process').spawn;\r\n\r\ntoReadStream(spawn('ls', ['-lah'])).on('error', function(err) {\r\n  throw err;\r\n}).on('end', function() {\r\n  console.log('~~~ DONE ~~~');\r\n}).on('data', function(data) {\r\n  console.log('ls data :::', data.toString());\r\n});\r\n```\r\n\r\nLimiting the output of the steam\r\n\r\n```js\r\nvar toReadStream = require('../index'),\r\n    spawn        = require('child_process').spawn,\r\n    limit, buf;\r\n\r\nbuf   = 0;\r\nlimit = 100 * 1024; // 100 Kb\r\n\r\n// Note that it's a 'soft' limit, meaning the data you\r\n// receive might be > 100 Kb, because the child process\r\n// was stopped after receiving more than <LIMIT> bytes\r\ntoReadStream(spawn('cat', ['/dev/urandom']), limit)\r\n  .on('error', function(err) {\r\n    throw err;\r\n  }).on('end', function(isLimited) {\r\n    console.log('done, ' + buf + ' bytes received');\r\n    if (isLimited) {\r\n      console.log('child process was cut');\r\n    }\r\n  }).on('data', function(data) {\r\n    buf += data.length;\r\n  });\r\n```\r\n\r\n### Tests\r\n\r\n```bash\r\nnpm test\r\n```\r\n\r\n## License\r\n\r\nMIT\r\n","maintainers":[{"name":"alessioalex","email":"alexandru.vladutu@gmail.com"}],"time":{"modified":"2022-06-26T22:39:04.972Z","created":"2013-07-09T14:16:47.975Z","0.0.1":"2013-07-09T14:16:50.827Z","0.1.0":"2013-08-02T15:41:24.934Z","0.1.1":"2014-05-21T14:02:29.399Z","0.1.2":"2014-05-21T14:09:38.675Z","0.1.3":"2014-05-21T14:39:37.887Z"},"author":{"name":"Alexandru Vladutu","email":"alexandru.vladutu@gmail.com"},"repository":{"type":"git","url":"git://github.com/alessioalex/spawn-to-readstream.git"},"keywords":["buffer-spawn-error","error","spawn","limit","spawn-error"],"bugs":{"url":"https://github.com/alessioalex/spawn-to-readstream/issues"},"license":"MIT","readmeFilename":"README.md","homepage":"https://github.com/alessioalex/spawn-to-readstream"}