0.0.1 • Published 7 years ago
promiseprops v0.0.1
PromiseProps
Like Promise.all but for object properties
Install
$ npm install --save promiseprops
Usage
import PromiseProps from 'promiseprops';
import got from 'got';
const fetch = url => got(url).then(res => res.body);
const sites = {
ava: fetch('ava.li'),
todomvc: fetch('todomvc.com'),
github: fetch('github.com'),
foo: 'bar'
};
PromiseProps(sites).then(result => {
console.log(result);
//=> {ava: '<!doctype ...', todomvc: '<!doctype ...', github: '<!doctype ...', foo: 'bar'}
});
0.0.1
7 years ago