Socket
Book a DemoInstallSign in
Socket

p0

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

p0

Minimal Promise/A+ implementation.

0.1.3
latest
Source
npmnpm
Version published
Weekly downloads
5
25%
Maintainers
1
Weekly downloads
 
Created
Source

Promises/A+ logo p0 build status

Minimal and fast Promise/A+ 1.1 implementation. It's all you need to pass the tests and build your own extended API.

Installation

Node.js

npm install p0

Browser

<script src="p0/index.min.js"></script>

Usage

var p0 = require('./');

var promise1 = new p0();

var promise2 = promise1.then(
    null,
    function(reason) {
        var promise3 = new p0();
        setTimeout(function() {
            promise3.fulfill(reason + 'bar');
        }, 100);
        return promise3;
    }
);

promise1.reject('foo');

promise2.then(function(value) { console.log(value); });
// will output "foobar" after 100ms

Fill free to use specs as more descriptive documentation.

License

MIT

Keywords

defer

FAQs

Package last updated on 21 Jul 2014

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.