0.0.1 • Published 7 years ago

promiseprops v0.0.1

Weekly downloads
2
License
MIT
Repository
github
Last release
7 years ago

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'}
});