Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

better-promise

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

better-promise

Forcing a minimum timeout on a Promise like the spec requires is needless and wasteful. BetterPromise allows synchronous resolutions to keep things moving quickly. In addition, BetterPromise will throw an error for any uncaught rejections, much like the N

  • 1.2.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3
decreased by-76.92%
Maintainers
1
Weekly downloads
 
Created
Source

BetterPromise

Forcing a minimum timeout on a Promise like the spec requires is needless and wasteful. BetterPromise allows synchronous resolutions to keep things moving quickly. In addition, BetterPromise will throw an error for any uncaught rejections, much like the Node.js Promise.

Try it out in your browser.

Install

npm install better-promise

API

Reference the BetterPromise class by require-ing it.

const Promise = require('better-promise');

BetterPromise has the same API as the native Promise class with the addition of a few static helper methods.

BetterPromise.defer() => Deferred

Returns a deferred object with promise, resolve, and reject properties.

BetterPromise.isPromise(obj) => Boolean

Recevies any value and returns whether or not that value looks like a Promise.

BetterPromise.promisify(fn[, context]) => Function

Receives a function and an optional context and returns a function that returns the given function wrapped in a BetterPromise.

FAQs

Package last updated on 03 Mar 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

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc