Huge news!Announcing our $20M Series A led by Andreessen Horowitz.Learn more
Socket
Socket
Log inDemoInstall

timers-browserify

Package Overview
Dependencies
1
Maintainers
41
Versions
24
Issues
File Explorer

Advanced tools

Install Socket

Protect your apps from supply chain attacks

Install

timers-browserify

timers module for browserify

    2.0.12latest
    GitHub
    npm

Version published
Maintainers
41
Weekly downloads
8,808,274
decreased by-2.98%

Weekly downloads

Changelog

Source

2.0.12 - 2020-10-27

Fixed

  • Remove .DS_Store from published package
  • Upgrade connect dev dependency

Readme

Source

Overview

Adds support for the timers module to browserify.

Wait, isn't it already supported in the browser?

The public methods of the timers module are:

  • setTimeout(callback, delay, [arg], [...])
  • clearTimeout(timeoutId)
  • setInterval(callback, delay, [arg], [...])
  • clearInterval(intervalId)

and indeed, browsers support these already.

So, why does this exist?

The timers module also includes some private methods used in other built-in Node.js modules:

  • enroll(item, delay)
  • unenroll(item)
  • active(item)

These are used to efficiently support a large quantity of timers with the same timeouts by creating only a few timers under the covers.

Node.js also offers the immediate APIs, which aren't yet available cross-browser, so we polyfill those:

  • setImmediate(callback, [arg], [...])
  • clearImmediate(immediateId)

I need lots of timers and want to use linked list timers as Node.js does.

Linked lists are efficient when you have thousands (millions?) of timers with the same delay. Take a look at timers-browserify-full in this case.

License

MIT

Keywords

FAQs

Last updated on 27 Oct 2020

Did you know?

Socket installs a GitHub app to automatically flag issues on every pull request and report the health of your dependencies. Find out what is inside your node modules and prevent malicious activity before you update the dependencies.

Install
SocketSocket SOC 2 Logo

Product

  • Package Issues
  • 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