|
Last change
on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 12 days ago |
|
Fix frontend appearance
|
-
Property mode
set to
100644
|
|
File size:
452 bytes
|
| Line | |
|---|
| 1 | 'use strict';
|
|---|
| 2 | const path = require('path');
|
|---|
| 3 | const findUp = require('find-up');
|
|---|
| 4 |
|
|---|
| 5 | const pkgDir = async cwd => {
|
|---|
| 6 | const filePath = await findUp('package.json', {cwd});
|
|---|
| 7 | return filePath && path.dirname(filePath);
|
|---|
| 8 | };
|
|---|
| 9 |
|
|---|
| 10 | module.exports = pkgDir;
|
|---|
| 11 | // TODO: Remove this for the next major release
|
|---|
| 12 | module.exports.default = pkgDir;
|
|---|
| 13 |
|
|---|
| 14 | module.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.