Sha256: b86cd2de54d0d6a1e34c2d652da48af8cb3abebaa0e50c8e34a2d0453950eebb
Contents?: true
Size: 958 Bytes
Versions: 62
Compression:
Stored size: 958 Bytes
Contents
var Q = require('q'); var RegistryClient = require('bower-registry-client'); var defaultConfig = require('../config'); function lookup(logger, name, config) { if (!name) { return new Q(null); } var registryClient; config = defaultConfig(config); config.cache = config.storage.registry; registryClient = new RegistryClient(config, logger); return Q.nfcall(registryClient.lookup.bind(registryClient), name) .then(function (entry) { // TODO: Handle entry.type.. for now it's only 'alias' // When we got published packages, this needs to be adjusted return !entry ? null : { name: name, url: entry && entry.url }; }); } // ------------------- lookup.readOptions = function (argv) { var cli = require('../util/cli'); var options = cli.readOptions(argv); var name = options.argv.remain[1]; return [name]; }; module.exports = lookup;
Version data entries
62 entries across 62 versions & 1 rubygems