Socket
Book a DemoInstallSign in
Socket

at-time

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

at-time

Execute a callack after a given timeout

1.1.0
latest
Source
npmnpm
Version published
Maintainers
1
Created
Source

Exec callback at time

var at = require('at-time')(saveCallback);

at.record('/path/to/file', {timeout: 1000*60*5}); // wait 5 minutes before store it

After a while the callback is called. If you record the same path multiple times the execution is postponed to a new time (next five minutes in this example).

Passing extra argument

You can pass a different argument to the callback function using the arg option

var at = require('at-time')(function(event) {
    console.log(event); // {path: "/path/to/file"}
});

at.record("/path/to/file", {timeout: 1000*10, arg: {path: "/path/to/file"}});

FAQs

Package last updated on 07 Jan 2017

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.