promised-help

0.0.6 • Public • Published

promised-help

Promised help is a series of helpers for native es6 promises, each helper returns another promise which can use another helper or you can resolve yourself.

This helper is great when you want to handle the resolution of your promises somewhere else in your stack (like in your page renderer).

Install

npm install promised-help --save

Avaliable helpers

.key(promise, key)

.key is a method which will take a promise and a key and return the value of the key.

Usage

var p = require('promised-help');
var title = p.key(promise, 'title');

title.then(function(response) {
    console.log(response); // the title key will be logged to the console
});

.slice(promise, start, end)

.slice is a method which allows you to get a slice of an array that is returned by the promise

.first(promise)

.first is a method which allows you to get a the first item in an array.

Readme

Keywords

Package Sidebar

Install

npm i promised-help

Weekly Downloads

6

Version

0.0.6

License

MIT

Last publish

Collaborators

  • jonthanfielding