@maserde/kimakjs
v0.0.3
Published
An epic error handling wrapper
Downloads
6
Maintainers
Readme
KimakJS
An epic error handling wrapper
Installation
Installing KimakJS on your project
npm install @maserde/kimakjs
Usage/Examples
Importing the library to your project
import Kimak from '@maserde/kimakjs'
Importing with CommonJS
const Kimak = require('@maserde/kimakjs')
Usage in synchronous code
import Kimak from '@maserde/kimakjs'
...
const kimak = new Kimak()
kimak.wrap('handlerName', () => {
JSON.parse('')
})
Usage in asynchronous code
import Kimak from '@maserde/kimakjs'
...
const kimak = new Kimak()
kimak.asyncWrap('asyncHandlerName', async () => {
return new Promise((_, reject) => reject('err'))
})