📅 You're Invited: Meet the Socket team at RSAC (April 28 – May 1).RSVP
Socket
Sign inDemoInstall
Socket

pinkie

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pinkie

Itty bitty little widdle twinkie pinkie ES2015 Promise implementation

2.0.4
latest
npm
Version published
Maintainers
1
Created

What is pinkie?

The 'pinkie' npm package is a lightweight promise implementation that follows the Promises/A+ specification. It is primarily used for handling asynchronous operations in environments where native promises are not available or when a minimalistic promise library is preferred.

What are pinkie's main functionalities?

Promise creation and resolution

This code demonstrates how to create a new promise using pinkie and resolve it with a value. The 'then' method is used to handle the resolved value.

const pinkie = require('pinkie');

const promise = new pinkie((resolve, reject) => {
  resolve('Success!');
});

promise.then(result => console.log(result));

Promise rejection and error handling

This example shows how to create a promise that gets rejected with an error and how to handle the error using the 'catch' method.

const pinkie = require('pinkie');

const promise = new pinkie((resolve, reject) => {
  reject(new Error('Failed!'));
});

promise.catch(error => console.error(error.message));

Other packages similar to pinkie

Keywords

promise

FAQs

Package last updated on 01 Feb 2016

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