New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

min-promise

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

min-promise

Small and Clean Promise 100% compliant with Promises/A+ Spec

  • 5.0.0
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
11
decreased by-35.29%
Maintainers
1
Weekly downloads
 
Created
Source

min-promise

Build status NPM version Downloads Dependency Status

Small and Clean Promise 100% compliant with Promises/A+ Spec

Installation

npm i min-promise

Support Both ES2015 Promise and Promises/A+

100% compliant with Promises/A+ Spec, and listed in implements

Check all tests in promises-aplus-tests

Feature

Support basic thenable in Promises/A+ Spec

Support ES2015 promise

  • new Promise() in ES2015
  • Promise.all() in ES2015
  • Promise.race() in ES2015

Support .caught like .catch for ES3 support, inspired by bluebird

Deferred

jQuery style or CommonJS Promises/A Deferred object

Promise is subset of Deferred

var $ = require('min-promise/jquery') // export `Deferred` and `when`

// $.Deferred
var dfd = $.Deferred()
dfd.done(function(v1, v2) {
  console.log(v1) // 1
  console.log(v2) // 2
})
Promise.delay(50).then(function() {
  dfd.resolve(1, 2)
})

// $.when
var d1 = $.Deferred()
var d2 = $.Deferred()
var d3 = $.Deferred()
$.when(d1, d2, d3).done(function(v1, v2, v3) {
  console.log([v1, v2, v3]) // [undefined, 'abc', 123]
})
d1.resolve()
d2.resolve('abc')
d3.resolve(123)

Tool function

setTimeout in promise style

  • Promise.delay(ms)
  • .delay(ms)

License

License

FAQs

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

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