Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

aku-aku

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

aku-aku

Guardian Spirit. It Interceps a function and exec a handler based on the result.

  • 1.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

aku


aku

Last version Build Status Dependency status Dev Dependencies Status NPM Status Donate

Guardian Spirit. It Interceps a function and exec a handler based on the result.

Bind a handler to exec under error and bind another for non error. Simple!

Similar to jif but for functions.

Install

$ npm install aku --save

API

We distinguish between sync or async methods:

  • aku(fn, handler, [errHandler])
  • aku.sync(fn, handler, [errHandler])

As you can see the library expose the async method by default.

fn

Required
Type: function

Input sync/async function to be handled.

handler

Required
Type: function

Handle that will be hooked under non error result.

errHandler

Type: function
Defaults: noop

Handle that will be hooked under error result.

As you can see it is an optional handled.

If you provided a sync method, then it throws an error after errHandler execution.

License

MIT © Kiko Beats

Keywords

FAQs

Package last updated on 24 Apr 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc