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.

12345678910
  1. 'use strict';
  2. const path = require('path');
  3. const findUp = require('find-up');
  4. module.exports = cwd => findUp('package.json', {cwd}).then(fp => fp ? path.dirname(fp) : null);
  5. module.exports.sync = cwd => {
  6. const fp = findUp.sync('package.json', {cwd});
  7. return fp ? path.dirname(fp) : null;
  8. };