source: trip-planner-front/node_modules/pkg-dir/index.js@ 8d391a1

Last change on this file since 8d391a1 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 452 bytes
Line 
1'use strict';
2const path = require('path');
3const findUp = require('find-up');
4
5const pkgDir = async cwd => {
6 const filePath = await findUp('package.json', {cwd});
7 return filePath && path.dirname(filePath);
8};
9
10module.exports = pkgDir;
11// TODO: Remove this for the next major release
12module.exports.default = pkgDir;
13
14module.exports.sync = cwd => {
15 const filePath = findUp.sync('package.json', {cwd});
16 return filePath && path.dirname(filePath);
17};
Note: See TracBrowser for help on using the repository browser.