Big update!Introducing GitHub Bot Commands. Learn more
Socket
Log inBook a demo

pinkie

Package Overview
Dependencies
0
Maintainers
1
Versions
9
Issues
File Explorer

Advanced tools

pinkie

Itty bitty little widdle twinkie pinkie ES2015 Promise implementation

    2.0.4latest

Version published
Maintainers
1
Weekly downloads
13,895,398
decreased by-10.02%

Weekly downloads

Readme

Source


pinkie

Itty bitty little widdle twinkie pinkie ES2015 Promise implementation

Build Status Coverage Status

There are tons of Promise implementations out there, but all of them focus on browser compatibility and are often bloated with functionality.

This module is an exact Promise specification polyfill (like native-promise-only), but in Node.js land (it should be browserify-able though).

Install

$ npm install --save pinkie

Usage

var fs = require('fs'); var Promise = require('pinkie'); new Promise(function (resolve, reject) { fs.readFile('foo.json', 'utf8', function (err, data) { if (err) { reject(err); return; } resolve(data); }); }); //=> Promise

API

pinkie exports bare ES2015 Promise implementation and polyfills Node.js rejection events. In case you forgot:

new Promise(executor)

Returns new instance of Promise.

executor

Required
Type: function

Function with two arguments resolve and reject. The first argument fulfills the promise, the second argument rejects it.

pinkie.all(promises)

Returns a promise that resolves when all of the promises in the promises Array argument have resolved.

pinkie.race(promises)

Returns a promise that resolves or rejects as soon as one of the promises in the promises Array resolves or rejects, with the value or reason from that promise.

pinkie.reject(reason)

Returns a Promise object that is rejected with the given reason.

pinkie.resolve(value)

Returns a Promise object that is resolved with the given value. If the value is a thenable (i.e. has a then method), the returned promise will "follow" that thenable, adopting its eventual state; otherwise the returned promise will be fulfilled with the value.

  • pinkie-promise - Returns the native Promise or this module

License

MIT © Vsevolod Strukchinsky

Keywords

FAQs

What is pinkie?

Itty bitty little widdle twinkie pinkie ES2015 Promise implementation

Is pinkie popular?

The npm package pinkie receives a total of 13,242,095 weekly downloads. As such, pinkie popularity was classified as popular.

Is pinkie well maintained?

We found that pinkie 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.

Last updated on 01 Feb 2016

Did you know?

Socket installs a Github app to automatically flag issues on every pull request and report the health of your dependencies. Find out what is inside your node modules and prevent malicious activity before you update the dependencies.

Install Socket
Socket

Product

Subscribe to our newsletter

Get open source security insights delivered straight into your inbox. Be the first to learn about new features and product updates.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc