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

es6-deferred-promise

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

es6-deferred-promise

A deferred promise implementation on top of Promises/A+ spec.

  • 1.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

es6-deferred-promise

A deferred promise implementation on top of Promises/A+ spec. TypeScript definition file included.

Installation

npm install --save es6-deferred-promise

Usage

In ES2015 JavaScript:

const Deferred = require('es6-deferred-promise').Deferred;
const deferred = new Deferred();

deferred.promise
  .then(result => {
    console.log('Result: %s', result);
  });

// Resolving a promise
deferred.resolve('Success!');

// Rejecting a promise
deferred.reject('Failure!');

In TypeScript:

import { Deferred } from 'es6-deferred-promise';

const deferred = new Deferred<string>();

deferred.promise
  .then(result => {
    console.log(result);
  });

deferred.resolve('success');

Testing

npm install
npm test

Keywords

FAQs

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