🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis →
Socket
Book a DemoInstallSign in
Socket

defer

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

defer

Defer execution of a task.

latest
Source
npmnpm
Version
1.0.0
Version published
Weekly downloads
71
-45.8%
Maintainers
1
Weekly downloads
 
Created
Source

Defer

Defer execution of a task.

Installation

npm install --save defer

Usage

const defer = require('defer')

async function signup (input) {
  // create user

  defer(async () => {
    // send welcome email
  })

  return user
}

API

defer(fn): Promise

Returns a Promise that will resolve with the return value of fn. The function fn will be invoked at a later stage in the event loop.

FAQs

Package last updated on 04 Dec 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