initial commit

This commit is contained in:
Kegan Myers 2015-07-07 23:42:25 -05:00
commit 829366aaaf
3 changed files with 40 additions and 0 deletions

1
.gitignore vendored Normal file
View file

@ -0,0 +1 @@
node_modules

10
index.js Normal file
View file

@ -0,0 +1,10 @@
var lodash = require("lodash");
var Q = require("q");
function mapObjectPromises(input, func) {
return Q.all(_.map(input, func)).then(function(data) {
return _.zipObject(_.keys(input), data);
});
}
module.exports = mapObjectPromises;

29
package.json Normal file
View file

@ -0,0 +1,29 @@
{
"name": "promise-map-object",
"version": "0.0.1",
"description": "A simple helper function to map an object's values via promises",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "https://github.com/terribleplan/promise-map-object.git"
},
"keywords": [
"promise",
"object",
"map",
"values"
],
"author": "Kegan Myers <kegan@keganmyers.com>",
"license": "ISC",
"bugs": {
"url": "https://github.com/terribleplan/promise-map-object/issues"
},
"homepage": "https://github.com/terribleplan/promise-map-object",
"dependencies": {
"lodash": "^3.10.0",
"q": "^1.4.1"
}
}