error-foundry-js
0.1.0 • Public • Published error-foundry-js
A minimalistic Javascript Universal Module to create custom errors.
Installation
npm install error-foundry-js --save
or
bower install error-foundry-js --save
Usage
Node
var
ErrorFoundry = require('error-foundry-js');
var
CustomError = ErrorFoundry.forge('CustomError');
throw new CustomError();
Browser
Globals
<script src="js/vendor/ErrorFoundry.min.js">
<script>
var
CustomError = ErrorFoundry.forge('CustomError');
throw new CustomError();
</script>
AMD
define([ 'ErrorFoundry' ], function (ErrorFoundry) {
var
CustomError = ErrorFoundry.forge('CustomError');
return CustomError;
});
Package Sidebar
Install
Weekly Downloads