Security News
PyPI’s New Archival Feature Closes a Major Security Gap
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
resolve-when
Advanced tools
Returns a promise that resolves once condition is met
resolve-when
is published at npmjs.com, and can be installed using npm
or yarn
.
$ npm install resolve-when # npm
$ yarn add resolve-when # yarn
import resolveWhen from 'resolve-when'; // ES6+
const resolveWhen = require('resolve-when'); // ES5
resolveWhen
is a function with the following signature:
resolveWhen(condition, options)
condition
Function - a function that will be evaluated to determine when resolveWhen
should resolve. It is not passed any parameters. Defaults to a function that always resolves to true
options
Object
max
Integer - Maximum number of times that condition
should be ran. If max
is undefined, 0
, a negative number, or Infinity
, it will iterate forever. Defaults to undefined
interval
Integer - Number of milliseconds to wait before running condition
again. Defaults to 50
resolveWhen.defaults
is a read-only property containing the default options
object used.
If condition
returns true, resolveWhen
will resolve without any value.
If the maximum number of iterations has been reached and condition
has not returned true
, resolveWhen
will reject with Error(`Maximum iterations (${max}) exceeded`)
, where max
is the same as options.max
$ git clone git@github.com:d4nyll/resolve-when.git
$ yarn
$ yarn run test
Tests are written in Mocha with the assert
module. We are also using lolex
as a fake timer to ensure our unit tests run as quick as possible.
We have used husky
to help you ensure:
Any PRs which does not pass the linter, tests or coverage tools will be rejected.
FAQs
Returns a promise that resolves once condition is met
The npm package resolve-when receives a total of 45 weekly downloads. As such, resolve-when popularity was classified as not popular.
We found that resolve-when demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
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.
Security News
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
Research
Security News
Malicious npm package postcss-optimizer delivers BeaverTail malware, targeting developer systems; similarities to past campaigns suggest a North Korean connection.
Security News
CISA's KEV data is now on GitHub, offering easier access, API integration, commit history tracking, and automated updates for security teams and researchers.