Home > @microsoft/rush-lib > PackageJsonEditor

PackageJsonEditor class

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Signature:

export declare class PackageJsonEditor 

Properties

Property Modifiers Type Description
dependencyList   ReadonlyArray<PackageJsonDependency> (BETA) The list of dependencies of type DependencyType.Regular, DependencyType.Optional, or DependencyType.Peer.
devDependencyList   ReadonlyArray<PackageJsonDependency> (BETA) The list of dependencies of type DependencyType.Dev.
filePath   string (BETA)
name   string (BETA)
version   string (BETA)

Methods

Method Modifiers Description
addOrUpdateDependency(packageName, newVersion, dependencyType)   (BETA)
fromObject(object, filename) static (BETA)
load(filePath) static (BETA)
saveIfModified()   (BETA)
tryGetDependency(packageName)   (BETA)
tryGetDevDependency(packageName)   (BETA)