🚀 DAY 5 OF LAUNCH WEEK: Introducing Socket Firewall Enterprise.Learn more →
Socket
Book a DemoInstallSign in
Socket

@rootstream/once

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@rootstream/once

async friendly version of https://www.npmjs.com/package/once

latest
Source
npmnpm
Version
1.0.2
Version published
Maintainers
1
Created
Source

once

CircleCI

async friendly version of https://www.npmjs.com/package/once

usage

in your npm console:

npm install --save @rootstream/once

in your code:

const once = require('@rootstream/once');

async function sample() { /* ... */ };
// guarantees sample() is called only and only once during app's lifetime
const sampleOnce = once(sample)
// guarantees sample() is called only and only once during function's execution lifetime
const sampleOnceReentrant = once(sample, { reentrant: true })

FAQs

Package last updated on 29 Dec 2019

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