{"_id":"limit-spawn","_rev":"11-49fe7994ecd8e7ea3e0522666c5e411a","name":"limit-spawn","description":"Kills a child process created with spawn after X bytes are sent","dist-tags":{"latest":"0.0.3"},"versions":{"0.0.1":{"author":{"name":"Alexandru Vladutu","email":"alexandru.vladutu@gmail.com"},"license":"MIT","name":"limit-spawn","description":"Kills a child process created with spawn after X bytes are sent","version":"0.0.1","repository":{"type":"git","url":"git://github.com/alessioalex/limit-spawn.git"},"main":"index.js","engines":{"node":">= 0.8.0"},"keywords":["spawn","limit"],"dependencies":{},"devDependencies":{"tap":"0.4.x"},"scripts":{"test":"node test/index.js"},"bugs":{"url":"https://github.com/alessioalex/limit-spawn/issues"},"_id":"limit-spawn@0.0.1","dist":{"shasum":"e121b4d544402d7e81379a8a8be5d642bbdba0b8","tarball":"https://registry.npmjs.org/limit-spawn/-/limit-spawn-0.0.1.tgz","integrity":"sha512-YVVO2JNKZoEC0STzWoCHEeYEryNFyyfizFv71JXWxOy3Ftk7BWpmapeWV+6OxwGRitl92ej7/gK7VJeTrGxYrA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIACGd8iytITKB/E+hm5BAbdapkVkJtY2fomjA1uOhZ0GAiEAoZEgIYFyWMvAnuiyh7QgzRPnTWBanTMzAcEaYkfoyPE="}]},"_from":".","_npmVersion":"1.2.32","_npmUser":{"name":"alessioalex","email":"alexandru.vladutu@gmail.com"},"maintainers":[{"name":"alessioalex","email":"alexandru.vladutu@gmail.com"}]},"0.0.2":{"author":{"name":"Alexandru Vladutu","email":"alexandru.vladutu@gmail.com"},"license":"MIT","name":"limit-spawn","description":"Kills a child process created with spawn after X bytes are sent","version":"0.0.2","repository":{"type":"git","url":"git://github.com/alessioalex/limit-spawn.git"},"main":"index.js","engines":{"node":">= 0.8.0"},"keywords":["spawn","limit"],"dependencies":{},"devDependencies":{"tap":"0.4.x"},"scripts":{"test":"node test/index.js"},"bugs":{"url":"https://github.com/alessioalex/limit-spawn/issues"},"_id":"limit-spawn@0.0.2","dist":{"shasum":"0c4c06697df1b75c6733e68febc07e4d41f4e5d9","tarball":"https://registry.npmjs.org/limit-spawn/-/limit-spawn-0.0.2.tgz","integrity":"sha512-dt7veOyKm4olEecCdw0/gEWs2RW8wZACBw78uCkNoUaWIKQbuF5k00+Q9qQW8rD4nINWdmBN7prwwV0dHiEVCg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCKT6B4Va6r7J4lEjh9VmKo7qGD54Yf5jHypX0LLMwLrQIgEu9NJZHlgy72saiYzG/ya9g9vV2d1mtNoop03PhEUOI="}]},"_from":".","_npmVersion":"1.2.32","_npmUser":{"name":"alessioalex","email":"alexandru.vladutu@gmail.com"},"maintainers":[{"name":"alessioalex","email":"alexandru.vladutu@gmail.com"}]},"0.0.3":{"author":{"name":"Alexandru Vladutu","email":"alexandru.vladutu@gmail.com"},"license":"MIT","name":"limit-spawn","description":"Kills a child process created with spawn after X bytes are sent","version":"0.0.3","repository":{"type":"git","url":"git://github.com/alessioalex/limit-spawn.git"},"main":"index.js","engines":{"node":">= 0.8.0"},"keywords":["spawn","limit"],"dependencies":{},"devDependencies":{"tap":"0.4.x"},"scripts":{"test":"node test/index.js"},"bugs":{"url":"https://github.com/alessioalex/limit-spawn/issues"},"homepage":"https://github.com/alessioalex/limit-spawn","_id":"limit-spawn@0.0.3","dist":{"shasum":"cc09c24467a0f0a1ed10a5196dba597cad3f65dc","tarball":"https://registry.npmjs.org/limit-spawn/-/limit-spawn-0.0.3.tgz","integrity":"sha512-2vJ6FDCit0ohq77qdbIdk5JqGs/98W1fGEgozoAMq/oybKPdgLuB8bHH/wWgvCdQzEJpm6Sxh0abG/PtxFr7XA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDsUdkFM944ifPW7xrjb4eQBaUU8v2OGJdCXrOJ/9gnAgIgImDWMOEvMrYQm05NNc5OD6ZBc/mKTHvf8UQc7M6DZlU="}]},"_from":".","_npmVersion":"1.3.14","_npmUser":{"name":"alessioalex","email":"alexandru.vladutu@gmail.com"},"maintainers":[{"name":"alessioalex","email":"alexandru.vladutu@gmail.com"}]}},"readme":"# limit-spawn\r\n\r\n### Description\r\n\r\nKills a child process created with spawn after X bytes are sent and emits an event.\r\n\r\n### Installation\r\n\r\n```bash\r\nnpm install limit-spawn\r\n```\r\n### Note\r\n\r\nThis is a soft limit, meaning that after more than MAX data is received the process is closed and the 'max-limit-exceeded' is emitted.\r\nSo this implies that you can receive more data than the limit (depending on the last chunk).\r\n\r\n### Examples\r\n\r\n```js\r\nvar spawn  = require('child_process').spawn,\r\n    limit  = require('../index'),\r\n    assert = require('assert'),\r\n    child, ps, bytesReceived, MAX_LIMIT;\r\n\r\nMAX_LIMIT = 100 * 1024; // 100 Kb\r\n\r\nchild = spawn('node', ['forever-output.js'], {\r\n  cwd: __dirname\r\n});\r\n\r\nlimit(child, MAX_LIMIT);\r\n\r\nbytesReceived = 0;\r\n\r\nchild.stdout.on('data', function(data) {\r\n  bytesReceived += data.length;\r\n});\r\n\r\nchild.stderr.pipe(process.stderr);\r\n\r\nchild.on('max-limit-exceeded', function(size) {\r\n  console.log('limit exceeded: ' + parseInt(size / 1024, 10) + ' Kb sent');\r\n});\r\n\r\n// shortly after the 'max-limit-exceeded' event is emitted the child dies\r\nchild.on('close', function(code) {\r\n  console.log('child process exited');\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-19T12:25:31.618Z","created":"2013-08-02T14:33:52.341Z","0.0.1":"2013-08-02T14:33:56.022Z","0.0.2":"2013-08-02T15:49:36.189Z","0.0.3":"2014-05-21T14:07:15.065Z"},"author":{"name":"Alexandru Vladutu","email":"alexandru.vladutu@gmail.com"},"repository":{"type":"git","url":"git://github.com/alessioalex/limit-spawn.git"},"keywords":["spawn","limit"],"bugs":{"url":"https://github.com/alessioalex/limit-spawn/issues"},"license":"MIT","readmeFilename":"README.md","homepage":"https://github.com/alessioalex/limit-spawn"}