Skip to main content

types-node

Build npm version

TypeScript type definitions for package.json manifests and package data structures. This package exists to break circular dependencies between rnx-kit packages that share these types.

Installation

yarn add @rnx-kit/types-node --dev

or if you're using npm

npm add --save-dev @rnx-kit/types-node

Usage

import type { PackageManifest, PackageData } from "@rnx-kit/types-node";

Types

Package Manifest Types

PackageManifest

Comprehensive type definitions for package.json files, including all standard npm fields plus the rnx-kit configuration field (typed as KitConfig from @rnx-kit/types-kit-config).

Covers identity and metadata (name, version, license, author), entry points (main, module, types, exports), dependencies, scripts, engines, workspaces, and more.

PackageData<T>

Data structure representing a package's location and manifest.

NameTypeDescription
rootstringDirectory path for the package.json file.
manifestTParsed package manifest.

Supporting Types

PackageExports

A record mapping export paths to string entry points or ExportsGroup objects.

ExportsGroup

Conditional export map with types, import, require, and default fields.

PackagePerson

A package author or contributor, either as a string or a PersonEntry object with name, email, and url fields.

FundingEntry

A funding source, either as a URL string or an object with type and url.