RoadmapShopEvents
Skip to main content

Home > @rushstack/node-core-library > IPackageJson

IPackageJson interface

An interface for accessing common fields from a package.json file.

Signature:

export interface IPackageJson extends INodePackageJson 

Extends: INodePackageJson

Remarks

This interface describes a package.json file format whose name and version field are required. In some situations, the version field is optional; in that case, use the INodePackageJson interface instead.

More fields may be added to this interface in the future. For documentation about the package.json file format, see the CommonJS Packages specification and the NPM manual page.

Properties

PropertyModifiersTypeDescription
bin?string

(Optional) The main entry point for the package.

(Inherited from INodePackageJson)

dependencies?IPackageJsonDependencyTable

(Optional) An array of dependencies that must always be installed for this package.

(Inherited from INodePackageJson)

description?string

(Optional) A brief description of the package.

(Inherited from INodePackageJson)

devDependencies?IPackageJsonDependencyTable

(Optional) An array of dependencies that must only be installed for developers who will build this package.

(Inherited from INodePackageJson)

homepage?string

(Optional) The URL to the project's web page.

(Inherited from INodePackageJson)

license?string

(Optional) The name of the license.

(Inherited from INodePackageJson)

main?string

(Optional) The path to the module file that will act as the main entry point.

(Inherited from INodePackageJson)

namestring

The name of the package.

(Inherited from INodePackageJson)

optionalDependencies?IPackageJsonDependencyTable

(Optional) An array of optional dependencies that may be installed for this package.

(Inherited from INodePackageJson)

peerDependencies?IPackageJsonDependencyTable

(Optional) An array of dependencies that must be installed by a consumer of this package, but which will not be automatically installed by this package.

(Inherited from INodePackageJson)

private?boolean

(Optional) Indicates whether this package is allowed to be published or not.

(Inherited from INodePackageJson)

repository?string | IPackageJsonRepository

(Optional) The URL of the project's repository.

(Inherited from INodePackageJson)

resolutions?Record<string, string>

(Optional) A table of package version resolutions. This feature is only implemented by the Yarn package manager.

(Inherited from INodePackageJson)

scripts?IPackageJsonScriptTable

(Optional) A table of script hooks that a package manager or build tool may invoke.

(Inherited from INodePackageJson)

tsdocMetadata?string

(BETA) (Optional) The path to the TSDoc metadata file. This is still being standardized: https://github.com/microsoft/tsdoc/issues/7\#issuecomment-442271815

(Inherited from INodePackageJson)

types?string

(Optional) The path to the TypeScript *.d.ts file describing the module file that will act as the main entry point.

(Inherited from INodePackageJson)

typings?string

(Optional) Alias for types

(Inherited from INodePackageJson)

versionstringA version number conforming to the Semantic Versioning (SemVer) standard.