c-e
Making custom error classes

Install
npm i c-e
Usage
const ce = require('c-e');
const CustomError = ce();
const NestedError = ce('NestedError', CustomError);
new CustomError().name === 'CustomError';
new NestedError().name === 'NestedError';
new NestedError('test').message === 'test';
new NestedError() instanceof Error;
new NestedError() instanceof CustomError;
new NestedError() instanceof NestedError;
const MyError = ce('MyError', Error, function(a, b){
this.message = `${a + b}`;
this.a = a;
this.b = b;
});
new MyError(1, 2).message === '3';
new MyError(1, 2).a === 1;
new MyError(1, 2).b === 2;
License
MIT