Skip to content

npm

Contains utility functions for NPM package.json.

Interface Description
EditPackageJsonOptions Options for editPackageJson.
PackageLockJson A type of the package-lock.json file.
Function Description
editNpmShrinkWrapJson Reads, edits, and writes back the package-lock.json file using the provided edit function.
editPackageJson Reads, edits, and writes back the package.json file using the provided edit function.
editPackageJsonSync Reads, edits, and writes back the package.json file using the provided edit function.
editPackageLockJson Reads, edits, and writes back the package-lock.json file using the provided edit function.
editPackageLockJsonSync Reads, edits, and writes back the package-lock.json file using the provided edit function.
getNpmShrinkWrapJsonPath Resolves the path to the npm-shrinkwrap.json file in the specified folder or in the root if no folder is specified.
getPackageJsonPath Resolves the path to the package.json file in the specified folder or in the root if no folder is specified.
getPackageLockJsonPath Resolves the path to the package-lock.json file in the specified folder or in the root if no folder is specified.
readPackageJson Reads the package.json file from the specified folder or from the root if no folder is specified.
readPackageJsonSync Reads the package.json file from the specified folder or from the root if no folder is specified.
readPackageLockJson Reads the package-lock.json file from the specified folder or from the root if no folder is specified.
readPackageLockJsonSync Reads the package-lock.json file from the specified folder or from the root if no folder is specified.
writePackageJson Writes the provided PackageJson object to the package.json file in the specified folder or in the root.
writePackageJsonSync Writes the provided PackageJson object to the package.json file in the specified folder or in the root.
writePackageLockJson Writes the provided PackageJson object to the package-lock.json file in the specified folder or in the root.
writePackageLockJsonSync Writes the provided PackageLockJson object to the package-lock.json file in the specified folder or in the root.
Type Description
EditNpmShrinkWrapJsonOptions Options for editNpmShrinkWrapJson.
EditPackageJsonSyncOptions Options for editPackageJsonSync.
EditPackageLockJsonOptions Options for editPackageLockJson.
EditPackageLockJsonSyncOptions Options for editPackageLockJsonSync.