Software zum Installieren eines Smart-Mirror Frameworks , zum Nutzen von hochschulrelevanten Informationen, auf einem Raspberry-Pi.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

index.js 1.1KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. 'use strict';
  2. const path = require('path');
  3. const Conf = require('./lib/conf');
  4. const defaults = require('./lib/defaults');
  5. // https://github.com/npm/npm/blob/latest/lib/config/core.js#L101-L200
  6. module.exports = opts => {
  7. const conf = new Conf(Object.assign({}, defaults.defaults));
  8. conf.add(Object.assign({}, opts), 'cli');
  9. conf.addEnv();
  10. conf.loadPrefix();
  11. const projectConf = path.resolve(conf.localPrefix, '.npmrc');
  12. const userConf = conf.get('userconfig');
  13. if (!conf.get('global') && projectConf !== userConf) {
  14. conf.addFile(projectConf, 'project');
  15. } else {
  16. conf.add({}, 'project');
  17. }
  18. conf.addFile(conf.get('userconfig'), 'user');
  19. if (conf.get('prefix')) {
  20. const etc = path.resolve(conf.get('prefix'), 'etc');
  21. conf.root.globalconfig = path.resolve(etc, 'npmrc');
  22. conf.root.globalignorefile = path.resolve(etc, 'npmignore');
  23. }
  24. conf.addFile(conf.get('globalconfig'), 'global');
  25. conf.loadUser();
  26. const caFile = conf.get('cafile');
  27. if (caFile) {
  28. conf.loadCAFile(caFile);
  29. }
  30. return conf;
  31. };
  32. module.exports.defaults = Object.assign({}, defaults.defaults);