PageRenderTime 42ms CodeModel.GetById 19ms RepoModel.GetById 0ms app.codeStats 0ms

/tutorial/node_modules/typings/dist/bin-install.js

https://gitlab.com/adriancarayol/django-angular2
JavaScript | 41 lines | 40 code | 0 blank | 1 comment | 4 complexity | 868ca322988200d248aa2c3c6990c0e3 MD5 | raw file
  1. "use strict";
  2. var listify = require('listify');
  3. var typings_core_1 = require('typings-core');
  4. var cli_1 = require('./support/cli');
  5. function help() {
  6. return "\ntypings install (with no arguments, in package directory)\ntypings install [<name>=]<location>\n\n <name> Module name of the installed definition\n <location> The location to read from (described below)\n\nValid Locations:\n [<source>~]<pkg>[@<version>][#<tag>]\n file:<path>\n github:<org>/<repo>[/<path>][#<commitish>]\n bitbucket:<org>/<repo>[/<path>][#<commitish>]\n npm:<pkg>[/<path>]\n bower:<pkg>[/<path>]\n http(s)://<host>/<path>\n\n <source> The registry mirror: \"npm\", \"bower\", \"env\", \"global\", \"lib\" or \"dt\"\n When not specified, `defaultSource` in `.typingsrc` will be used.\n <path> Path to a `.d.ts` file or `typings.json`\n <host> A domain name (with optional port)\n <version> A semver range (E.g. \">=4.0\")\n <tag> The specific tag of a registry entry\n <commitish> A git commit, tag or branch\n\nOptions:\n [--save|-S] Persist to \"dependencies\"\n [--save-dev|-D] Persist to \"devDependencies\"\n [--save-peer|-P] Persist to \"peerDependencies\"\n [--global|-G] Install and persist as an global definition\n [-SG] Persist to \"globalDependencies\"\n [-DG] Persist to \"globalDevDependencies\"\n [--production] Install only production dependencies (omits dev dependencies)\n\nAliases: i, in\n";
  7. }
  8. exports.help = help;
  9. function exec(args, options) {
  10. var emitter = options.emitter;
  11. if (typeof options.ambient !== 'undefined') {
  12. cli_1.logError('The "ambient" flag is deprecated. Please use "global" instead', 'deprecated');
  13. return;
  14. }
  15. if (args.length === 0) {
  16. return typings_core_1.install(options)
  17. .then(function (result) {
  18. console.log(cli_1.archifyDependencyTree(result));
  19. });
  20. }
  21. emitter.on('reference', function (_a) {
  22. var reference = _a.reference, resolution = _a.resolution, name = _a.name;
  23. cli_1.logInfo("Stripped reference \"" + reference + "\" during installation from \"" + name + "\" (" + resolution + ")", 'reference');
  24. });
  25. emitter.on('globaldependencies', function (_a) {
  26. var name = _a.name, dependencies = _a.dependencies;
  27. var deps = Object.keys(dependencies).map(function (x) { return JSON.stringify(x); });
  28. if (deps.length) {
  29. cli_1.logInfo("\"" + name + "\" lists global dependencies on " + listify(deps) + " and should be installed", 'globaldependencies');
  30. }
  31. });
  32. return typings_core_1.installDependenciesRaw(args, options)
  33. .then(function (results) {
  34. for (var _i = 0, results_1 = results; _i < results_1.length; _i++) {
  35. var result = results_1[_i];
  36. console.log(cli_1.archifyDependencyTree(result));
  37. }
  38. });
  39. }
  40. exports.exec = exec;
  41. //# sourceMappingURL=bin-install.js.map