1.0.0 • Published 9 years ago
promise-get v1.0.0
promise-get
Get a property from the object a promise resolves to, using a dot path
Installation
Install promise-get
using npm:
npm install --save promise-get
Usage
Module usage
var get = require('promise-get');
get('key.deep', Promise.resolve({key: {deep: 'hello'}}))
.then(function (val) {
// val === 'hello'
});
API
get(property, promise)
Name | Type | Description |
---|---|---|
property | String | A dot path to get value from resolved promise |
promise | Promise | The promise which resolves to the object you want a property from |
Returns: Promise
, which resolves to the property found in promise
's resolved object.
Related
License
MIT © Joakim Carlstein
1.0.0
9 years ago