Both are only for reading the package.json in the current working directory, they do not traverse up the directory tree.
So we should be able to replace with:
const data = await readPackageJsonFast('./package.json');
// or
const packagePath = path.join(cwd, './package.json'); // `cwd` is passed in for npm-run-all at least
const data = await readPackageJsonFast(packagePath);
It is probably also worth moving people from npm-run-all to npm-run-all2 if we ever bump into that in other repos.
npm-run-all2 is a fork of npm-run-all: https://github.com/bcomnes/npm-run-all2
it was created since npm-run-all isn't actively maintained anymore
it depends on
read-pkg
which is fairly bloated. We can switch to npm's own read-package-json-fast: https://github.com/npm/read-package-json-fastBoth are only for reading the
package.json
in the current working directory, they do not traverse up the directory tree.So we should be able to replace with:
It is probably also worth moving people from npm-run-all to npm-run-all2 if we ever bump into that in other repos.