Skip to content

Commit

Permalink
set maxBuffer via environment variable
Browse files Browse the repository at this point in the history
default maxBuffer is 200K byte
MAX_BUFFER=5242880 npm start
take 5MB for maxBuffer

related to n1k0#23
  • Loading branch information
manabu authored Feb 21, 2017
1 parent 3e0cc2f commit 4d98ff5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scrape.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ module.exports = function scrape(url, options) {
if (options.userAgent) {
childArgs.push(options.userAgent);
}
childProcess.execFile(binPath, childArgs, function(err, stdout, stderr) {
childProcess.execFile(binPath, childArgs, {maxBuffer: process.env.MAX_BUFFER || 1024 * 200 }, function(err, stdout, stderr) {
if (err) {
return reject(err);
}
Expand Down

0 comments on commit 4d98ff5

Please sign in to comment.