Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export default (pkgPath: string) => limitPkgReads(() => readPackageJson(pkgPath))
export default async function safeReadPkg (pkgPath: string): Promise {
try {
return await readPkg(pkgPath)
} catch (err) {
if ((err as NodeJS.ErrnoException).code !== 'ENOENT') throw err
return null
}
}