vtils

Home > types > PackageJson > PackageJsonStandard

PackageJson.PackageJsonStandard interface

Type for [npm’s package.json file](https://docs.npmjs.com/creating-a-package-json-file). Containing standard npm properties.

Signature:

export interface PackageJsonStandard 

Properties

Property Modifiers Type Description
author?   Person (Optional)
bin?   | string | Record<string, string> (Optional) The executable files that should be installed into the PATH.
bugs?   BugsLocation (Optional) The URL to the package’s issue tracker and/or the email address to which issues should be reported.
bundledDependencies?   string[] (Optional) Package names that are bundled when the package is published.
bundleDependencies?   string[] (Optional) Alias of bundledDependencies.
config?   Record<string, unknown> (Optional) Is used to set configuration parameters used in package scripts that persist across upgrades.
contributors?   Person[] (Optional) A list of people who contributed to the package.
cpu?   Array<LiteralUnion< | ‘arm’ | ‘arm64’ | ‘ia32’ | ‘mips’ | ‘mipsel’ | ‘ppc’ | ‘ppc64’ | ‘s390’ | ‘s390x’ | ‘x32’ | ‘x64’ | ‘!arm’ | ‘!arm64’ | ‘!ia32’ | ‘!mips’ | ‘!mipsel’ | ‘!ppc’ | ‘!ppc64’ | ‘!s390’ | ‘!s390x’ | ‘!x32’ | ‘!x64’, string >> (Optional) CPU architectures the module runs on.
dependencies?   Dependency (Optional) The dependencies of the package.
description?   string (Optional) Package description, listed in npm search.
devDependencies?   Dependency (Optional) Additional tooling dependencies that are not required for the package to work. Usually test, build, or documentation tooling.
directories?   DirectoryLocations (Optional) Indicates the structure of the package.
engines?   { [EngineName in ‘npm’ | ‘node’ | string]: string; } (Optional) Engines that this package runs on.
engineStrict?   boolean (Optional)
exports?   Exports <p>(Optional) Standard entry points of the package, with enhanced support for ECMAScript Modules.</p><p>[Read more.](https://nodejs.org/api/esm.html#esm_package_entry_points)</p>
files?   string[] (Optional) The files included in the package.
funding?   string | { type?: LiteralUnion< | ‘github’ | ‘opencollective’ | ‘patreon’ | ‘individual’ | ‘foundation’ | ‘corporation’, string >; url: string; } <p>(Optional) Describes and notifies consumers of a package’s monetary support information.</p><p>[Read more.](https://github.com/npm/rfcs/blob/latest/accepted/0017-add-funding-support.md)</p>
homepage?   LiteralUnion<’.’, string> (Optional) The URL to the package’s homepage.
keywords?   string[] (Optional) Keywords associated with package, listed in npm search.
license?   string (Optional) The license for the package.
licenses?   Array<{ type?: string; url?: string; }> (Optional) The licenses for the package.
main?   string (Optional) The module ID that is the primary entry point to the program.
maintainers?   Person[] (Optional) A list of people who maintain the package.
man?   string | string[] (Optional) Filenames to put in place for the man program to find.
name?   string (Optional) The name of the package.
optionalDependencies?   Dependency (Optional) Dependencies that are skipped if they fail to install.
os?   Array<LiteralUnion< | ‘aix’ | ‘darwin’ | ‘freebsd’ | ‘linux’ | ‘openbsd’ | ‘sunos’ | ‘win32’ | ‘!aix’ | ‘!darwin’ | ‘!freebsd’ | ‘!linux’ | ‘!openbsd’ | ‘!sunos’ | ‘!win32’, string >> (Optional) Operating systems the module runs on.
peerDependencies?   Dependency (Optional) Dependencies that will usually be required by the package user directly or via another dependency.
peerDependenciesMeta?   Record<string, {optional: true}> (Optional) Indicate peer dependencies that are optional.
preferGlobal?   boolean (Optional) If set to true, a warning will be shown if package is installed locally. Useful if the package is primarily a command-line application that should be installed globally.
private?   boolean (Optional) If set to true, then npm will refuse to publish it.
publishConfig?   PublishConfig (Optional) A set of config values that will be used at publish-time. It’s especially handy to set the tag, registry or access, to ensure that a given package is not tagged with ‘latest’, published to the global public registry or that a scoped module is private by default.
repository?   | string | { type: string; url: string; directory?: string; } (Optional) Location for the code repository.
scripts?   Scripts (Optional) Script commands that are run at various times in the lifecycle of the package. The key is the lifecycle event, and the value is the command to run at that point.
type?   ‘module’ | ‘commonjs’ <p>(Optional) Resolution algorithm for importing “.js” files from the package’s scope.</p><p>[Read more.](https://nodejs.org/api/esm.html#esm_package_json_type_field)</p>
version?   string (Optional) Package version, parseable by [node-semver](https://github.com/npm/node-semver).