Socket
Socket
Sign inDemoInstall

holding

Package Overview
Dependencies
0
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    holding

Holding a callback for some times.


Version published
Maintainers
1
Install size
6.99 kB
Created

Readme

Source

holding

Holding a callback for some times

NPM Version Download Status Dependencies

Installation

$ npm install holding

API

const holding = require('holding');
const done = holding(2, function() {
  console.log(this, 'called');
}, this);

done();
done();
done(); // it works

done.times; // show called times
done.called; // show fn call status
holding(n, fn, context)
  • n - {Number}

    holding times, it will execute fn after n times.

  • fn - {Function}

    holding callback.

  • context - {Any}

    fn context.

holding(n, fn, context).times
  • show called times.
holding(n, fn, context).called
  • show fn call status.
holding.assert(n, fn, context)
  • function for assertion testing, will throw error if call times out of range.

License

MIT

Keywords

FAQs

Last updated on 22 Apr 2019

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc