Build NapCat Artifacts / Windows Loader Test (push) Canceled after 0s
Build NapCat Artifacts / Type Check & Test (push) Canceled after 0s
Build NapCat Artifacts / Build NapCat.Framework (push) Canceled after 0s
Build NapCat Artifacts / Build NapCat.Shell (push) Canceled after 0s
21 lines
457 B
Plaintext
21 lines
457 B
Plaintext
import fs from 'node:fs';
|
|
import { pkgUp } from './pkg-up.js';
|
|
function stripBOM(str) {
|
|
return str.replace(/^\uFEFF/, '');
|
|
}
|
|
export function readPkgUp(opts) {
|
|
const fp = pkgUp(opts);
|
|
if (!fp) {
|
|
return {};
|
|
}
|
|
try {
|
|
return {
|
|
pkg: JSON.parse(stripBOM(fs.readFileSync(fp, { encoding: 'utf8' }))),
|
|
path: fp,
|
|
};
|
|
}
|
|
catch {
|
|
return {};
|
|
}
|
|
}
|
|
//# sourceMappingURL=read-pkg-up.js.map |