1.0.1 • Published 8 years ago

max-buffer-exceeded-error v1.0.1

Weekly downloads
2
License
MIT
Repository
github
Last release
8 years ago

max-buffer-exceeded-error

NPM version Build Status Coverage Status Dependency Status devDependency Status

A better Error class for "maxBuffer exceeded" errors

const {execFile} = require('child_process');

execFile('npm', {maxBuffer: 10}, err => {
  err; //=> Error: stdout maxBuffer exceeded
});
const MaxBufferExceededError = require('max-buffer-exceeded-error');

new MaxBufferExceededError('stdout', 10);
/*
  => { [MaxBufferExceededError: stdout maxBuffer exceeded. (>10)]
       message: 'stdout maxBuffer exceeded. (>10)',
       maxBuffer: 10 }
*/

Installation

Use npm.

npm install max-buffer-exceeded-error

API

const MaxBufferExceededError = require('max-buffer-exceeded-error');

new MaxBufferExceededError(name. maxBuffer)

name: String (a name of what limits the buffer size e.g. stdout, stderr)
maxBuffer: number (size of the max buffer)
Return: MaxBufferExceededError instance

License

Copyright (c) 2015 Shinnosuke Watanabe

Licensed under the MIT License.