with-error
Either monad for work with exceptions in JavaScript. Go-style.
Why?
Because, exceptions may be the way to callback-hell.
trycatche
Install
npm install with-error --save
or
yarn add with-error
Usage
; // Non-promisify successfully result; console.logresult.toUpperCase; // RESULT1 // Non-promisify failure result; if error // Promisify successfully result; console.logresult.toUpperCase; // RESULT1 // Non-promisify failure result ;if error // Also supported array-like response ;
API
// Response;// non-promisify with-error// promisify with-error
Test
npm install
npm test