
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
native-or-another
Advanced tools
Export either the native Promise or Bluebird (using native-or-bluebird) as deferred object.
Export either the native Promise or Bluebird (using native-or-bluebird) as deferred object.
$ npm install native-or-another
$ npm test
For more use-cases see the tests
var assert = require('assert');
var Deferred = require('native-or-another');
var defer = new Deferred();
defer.resolve(1);
defer.promise.then(function fulfilled(val) {
assert.strictEqual(val, 1);
done();
});
// catching errors
defer.reject(new Error('custom error'));
defer.promise.catch(function rejected(err) {
assert.ok(err instanceof Error);
assert.strictEqual(err.message, 'custom error');
done();
});
Charlike Mike Reagent
Copyright (c) 2014 Charlike Mike Reagent, contributors.
Released under the MIT
license.
Powered and automated by readdirp + hogan.js, December 21, 2014
FAQs
Guaranteed way for getting a Promise. Always native Promise if available, otherwise looks for common promise libraries and loads which is installed. Allows registering custom Promise implementation in node < 0.12 versions
The npm package native-or-another receives a total of 2,770 weekly downloads. As such, native-or-another popularity was classified as popular.
We found that native-or-another 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
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.