Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const getMain = memoize(path =>
readFile(resolve(path, "package.json"), readFileOpts)(content => {
const { main } = parse(stripBOM(content));
if (!main) throw new Error("No main setting found");
return main;
})
);
const readFileData = function (filename, fileParser, localFilename) {
return readFile(filename, readFileOpts)(code =>
readFileContent(code, filename, fileParser, localFilename)
);
};