bighook

1.1.11 • Public • Published

bighook

Easily hook on to the beginning or end of function calls


Repo stats


Installation

npm i bighook

Example

const Bighook = require('bighook');

let val1;
let val2;
const setVal1 = () => {
  val1 = 'Hello world!';
};

const hook = new Bighook(setVal1);

hook
  .before(() => {
    val2 = 'foo';
  })
  .after(() => {
    val1 = 'bar';
  });

hook.function()();
console.log(val1, val2); // "bar foo"

Docs

The docs can be found here

Package Sidebar

Install

npm i bighook

Weekly Downloads

14

Version

1.1.11

License

MIT

Unpacked Size

6.07 kB

Total Files

10

Last publish

Collaborators

  • shreyasm-dev