You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

18 lines
474 B
JavaScript

"use strict";
const Promise = require("bluebird");
const mapObj = require("map-obj");
const nixLocate = require("./nix-locate");
const selectBestPackage = require("./select-best-package");
module.exports = function findPackages(libraries) {
return Promise.try(() => {
return nixLocate(libraries);
}).then((groupedResults) => {
return mapObj(groupedResults, (library, results) => {
return [ library, selectBestPackage(library, results).attribute ];
});
});
};