Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function findNamedPackage (filePath) {
const found = readPackage({cwd: filePath})
// console.log(found)
if (found.package && !found.package.name) {
return findNamedPackage(path.join(found.path, '../..'))
}
return found
}