Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/shinnn/max-buffer-exceeded-error
A better error class for "maxBuffer exceeded" errors
https://github.com/shinnn/max-buffer-exceeded-error
Last synced: 27 days ago
JSON representation
A better error class for "maxBuffer exceeded" errors
- Host: GitHub
- URL: https://github.com/shinnn/max-buffer-exceeded-error
- Owner: shinnn
- License: mit
- Created: 2015-11-28T16:20:17.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2016-10-29T08:30:51.000Z (about 8 years ago)
- Last Synced: 2024-10-03T06:44:19.900Z (about 1 month ago)
- Language: JavaScript
- Size: 3.91 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# max-buffer-exceeded-error
[![NPM version](https://img.shields.io/npm/v/max-buffer-exceeded-error.svg)](https://www.npmjs.com/package/max-buffer-exceeded-error)
[![Build Status](https://travis-ci.org/shinnn/max-buffer-exceeded-error.svg?branch=master)](https://travis-ci.org/shinnn/max-buffer-exceeded-error)
[![Coverage Status](https://img.shields.io/coveralls/shinnn/max-buffer-exceeded-error.svg)](https://coveralls.io/github/shinnn/max-buffer-exceeded-error)
[![Dependency Status](https://david-dm.org/shinnn/max-buffer-exceeded-error.svg)](https://david-dm.org/shinnn/max-buffer-exceeded-error)
[![devDependency Status](https://david-dm.org/shinnn/max-buffer-exceeded-error/dev-status.svg)](https://david-dm.org/shinnn/max-buffer-exceeded-error#info=devDependencies)A better `Error` class for "maxBuffer exceeded" errors
```javascript
const {execFile} = require('child_process');execFile('npm', {maxBuffer: 10}, err => {
err; //=> Error: stdout maxBuffer exceeded
});
``````javascript
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.](https://docs.npmjs.com/cli/install)
```
npm install max-buffer-exceeded-error
```## API
```javascript
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](https://github.com/shinnn)
Licensed under [the MIT License](./LICENSE).