Initial project import
This commit is contained in:
17
node_modules/concurrently/dist/bin/read-package-json.js
generated
vendored
Normal file
17
node_modules/concurrently/dist/bin/read-package-json.js
generated
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
import { readFileSync } from 'node:fs';
|
||||
import { createRequire } from 'node:module';
|
||||
/**
|
||||
* Read the package.json file of `concurrently`
|
||||
*/
|
||||
export function readPackageJson() {
|
||||
let resolver;
|
||||
try {
|
||||
resolver = require.resolve;
|
||||
}
|
||||
catch {
|
||||
resolver = createRequire(import.meta.url).resolve;
|
||||
}
|
||||
const path = resolver('concurrently/package.json');
|
||||
const content = readFileSync(path, 'utf8');
|
||||
return JSON.parse(content);
|
||||
}
|
||||
Reference in New Issue
Block a user