https://github.com/sdgluck/error-clean-stack
throw errors with clean stacks
https://github.com/sdgluck/error-clean-stack
Last synced: 9 months ago
JSON representation
throw errors with clean stacks
- Host: GitHub
- URL: https://github.com/sdgluck/error-clean-stack
- Owner: sdgluck
- License: mit
- Created: 2017-09-10T14:49:30.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-09-10T15:33:17.000Z (over 8 years ago)
- Last Synced: 2025-08-09T05:43:25.817Z (10 months ago)
- Language: JavaScript
- Size: 72.3 KB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# error-clean-stack
> errors with [clean stacks](https://github.com/sindresorhus/clean-stack)
Made with ❤ at [@outlandish](http://www.twitter.com/outlandish)
## Install
```sh
npm install --save error-clean-stack
```
```sh
yarn add error-clean-stack
```
## Import
```js
// ES2015
import cleanErrors from 'error-clean-stack'
```
```js
// CommonJS
var cleanErrors = require('error-clean-stack')
```
## Errors
All errors are exported as named exports.
```sh
Error
ReferenceError
EvalError
RangeError
ReferenceError
SyntaxError
TypeError
URIError
```
## Example:
### `examples/error.js`
```js
const {Error} = require('error-clean-stack')
function a () {
function b () {
throw new Error()
}
b()
}
a()
```
```sh
$ node examples/error.js
C:\xampp\htdocs\error-clean-stack\examples\error.js:5
throw new Error()
^
Error
at b (C:/xampp/htdocs/error-clean-stack/examples/error.js:5:11)
at a (C:/xampp/htdocs/error-clean-stack/examples/error.js:7:3)
at Object. (C:/xampp/htdocs/error-clean-stack/examples/error.js:10:1)
```
## Contributing
All pull requests and issues welcome!
If you're not sure how, check out the [great video tutorials on egghead.io](http://bit.ly/2aVzthz)!
## License
MIT © [Sam Gluck](https://github.com/sdgluck)