mrm
mrm copied to clipboard
Feature request: add `updateLockfile` to `packageJson`
Some of the fields in package.json
is present in package-lock.json
, e.g engines
. It would be useful to have a helper to update the lockfile as well:
const pkg = packageJson();
pkg.merge({
engines: {
node: ">= 12.0",
},
});
pkg.save();
After pkg.save()
it would be useful to have a new function to update the lockfile:
pkg.updateLockfile();
or perhaps a flag to save()
:
pkg.save({
updateLockfile: true,
});
My current workaround is to call spawnSync
(I noticed execCommand
was implemented in that way):
spawnSync("npm", ["install"]);