limit-spawn
Advanced tools
Comparing version
@@ -0,0 +0,0 @@ setInterval(function() { |
@@ -0,0 +0,0 @@ var spawn = require('child_process').spawn, |
10
index.js
@@ -9,8 +9,10 @@ /** | ||
*/ | ||
var os = require('os'); | ||
var SIGNAL = (os.platform().indexOf('win') !== -1) ? 'SIGKILL': 'SIGHUP'; | ||
function limit(ps, max) { | ||
var size; | ||
if (!limit) { return ps; } | ||
size = 0; | ||
var size = 0; | ||
@@ -24,3 +26,3 @@ ps.stdout.on('data', function(data) { | ||
ps.emit('max-limit-exceeded', size); | ||
ps.kill('SIGHUP'); | ||
ps.kill(SIGNAL); | ||
} | ||
@@ -27,0 +29,0 @@ }); |
@@ -6,3 +6,3 @@ { | ||
"description": "Kills a child process created with spawn after X bytes are sent", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"repository": { | ||
@@ -9,0 +9,0 @@ "type": "git", |
@@ -0,0 +0,0 @@ # limit-spawn |
@@ -0,0 +0,0 @@ var test = require('tap').test, |
@@ -0,0 +0,0 @@ setInterval(function() { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
5643
5.85%86
1.18%