index.js 809 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. //
  2. 'use strict';
  3. const os = require('os');
  4. const createExplorer = require('./createExplorer');
  5. const homedir = os.homedir();
  6. module.exports = function cosmiconfig(
  7. moduleName ,
  8. options
  9. ) {
  10. options = Object.assign(
  11. {},
  12. {
  13. packageProp: moduleName,
  14. rc: `.${moduleName}rc`,
  15. js: `${moduleName}.config.js`,
  16. rcStrictJson: false,
  17. stopDir: homedir,
  18. cache: true,
  19. sync: false,
  20. },
  21. options
  22. );
  23. return createExplorer(options);
  24. };