Type object
File match package.json
Schema URL https://catalog.lintel.tools/schemas/schemastore/package-json/latest.json
Source https://www.schemastore.org/package.json

Validate with Lintel

npx @lintel/lintel check
Type: object

Properties

name string

The name of the package.

minLength=1maxLength=214pattern=^(?:(?:@(?:[a-z0-9-*~][a-z0-9-*._~]*)?/[a-z0-9-._~])|[a-z0-9-~])[a-z0-9-._~]*$
version string

Version must be parsable by node-semver, which is bundled with npm as a dependency.

description string

This helps people discover your package, as it's listed in 'npm search'.

keywords string[]

This helps people discover your package as it's listed in 'npm search'.

homepage string

The url to the project homepage.

bugs object | string

The url to your project's issue tracker and / or the email address to which issues should be reported. These are helpful for people who encounter issues with your package.

2 nested properties
url string

The url to your project's issue tracker.

format=uri
email string

The email address to which issues should be reported.

format=email
license string | enum
licenses object[]

DEPRECATED: Instead, use SPDX expressions, like this: { "license": "ISC" } or { "license": "(MIT OR Apache-2.0)" } see: 'https://docs.npmjs.com/files/package.json#license'.

A person who has been involved in creating or maintaining this package.

3 nested properties
name string required
url string
format=uri
email string
format=email
contributors person[]

A list of people who contributed to this package.

maintainers person[]

A list of people who maintains this package.

files string[]

The 'files' field is an array of files to include in your project. If you name a folder in the array, then it will also include the files inside that folder.

main string

The main field is a module ID that is the primary entry point to your program.

The "exports" field is used to restrict external access to non-exported module files, also enables a module to import itself using "name".

imports object

The "imports" field is used to create private mappings that only apply to import specifiers from within the package itself.

bin Record<string, string>
type string

When set to "module", the type field allows a package to specify all .js files within are ES modules. If the "type" field is omitted or set to "commonjs", all .js files are treated as CommonJS.

Default: "commonjs"
Values: "commonjs" "module"
types string

Set the types property to point to your bundled declaration file.

typings string

Note that the "typings" field is synonymous with "types", and could be used as well.

typesVersions Record<string, object>

The "typesVersions" field is used since TypeScript 3.1 to support features that were only made available in newer TypeScript versions.

man array | string

Specify either a single file or an array of filenames to put in place for the man program to find.

directories object
6 nested properties
bin string

If you specify a 'bin' directory, then all the files in that folder will be used as the 'bin' hash.

doc string

Put markdown files in here. Eventually, these will be displayed nicely, maybe, someday.

example string

Put example scripts in here. Someday, it might be exposed in some clever way.

lib string

Tell people where the bulk of your library is. Nothing special is done with the lib folder in any way, but it's useful meta info.

man string

A folder that is full of man pages. Sugar to generate a 'man' array by walking the folder.

test string
repository object | string

Specify the place where your code lives. This is helpful for people who want to contribute.

3 nested properties
type string
url string
directory string
funding fundingUrl | fundingWay | fundingUrl | fundingWay[]
scripts Record<string, string>

The 'scripts' member is an object hash of script commands that are run at various times in the lifecycle of your package. The key is the lifecycle event, and the value is the command to run at that point.

30 nested properties
lint string

Run code quality tools, e.g. ESLint, TSLint, etc.

prepublish string

Run BEFORE the package is published (Also run on local npm install without any arguments).

prepare string

Runs BEFORE the package is packed, i.e. during "npm publish" and "npm pack", and on local "npm install" without any arguments. This is run AFTER "prepublish", but BEFORE "prepublishOnly".

prepublishOnly string

Run BEFORE the package is prepared and packed, ONLY on npm publish.

prepack string

run BEFORE a tarball is packed (on npm pack, npm publish, and when installing git dependencies).

postpack string

Run AFTER the tarball has been generated and moved to its final destination.

publish string

Publishes a package to the registry so that it can be installed by name. See https://docs.npmjs.com/cli/v8/commands/npm-publish

postpublish string

Run AFTER the package is published.

preinstall string

Run BEFORE the package is installed.

install string

Run AFTER the package is installed.

postinstall string

Run AFTER the package is installed.

preuninstall string

Run BEFORE the package is uninstalled.

uninstall string

Run BEFORE the package is uninstalled.

postuninstall string

Run AFTER the package is uninstalled.

preversion string

Run BEFORE bump the package version.

version string

Run BEFORE bump the package version.

postversion string

Run AFTER bump the package version.

pretest string

Run by the 'npm test' command.

test string

Run by the 'npm test' command.

posttest string

Run by the 'npm test' command.

prestop string

Run by the 'npm stop' command.

stop string

Run by the 'npm stop' command.

poststop string

Run by the 'npm stop' command.

prestart string

Run by the 'npm start' command.

start string

Run by the 'npm start' command.

poststart string

Run by the 'npm start' command.

prerestart string

Run by the 'npm restart' command. Note: 'npm restart' will run the stop and start scripts if no restart script is provided.

restart string

Run by the 'npm restart' command. Note: 'npm restart' will run the stop and start scripts if no restart script is provided.

postrestart string

Run by the 'npm restart' command. Note: 'npm restart' will run the stop and start scripts if no restart script is provided.

serve string

Start dev server to serve application files

config object

A 'config' hash can be used to set configuration parameters used in package scripts that persist across upgrades.

dependencies Record<string, string>

Dependencies are specified with a simple hash of package name to version range. The version range is a string which has one or more space-separated descriptors. Dependencies can also be identified with a tarball or git URL.

devDependencies Record<string, string>

Specifies dependencies that are required for the development and testing of the project. These dependencies are not needed in the production environment.

optionalDependencies Record<string, string>

Specifies dependencies that are optional for your project. These dependencies are attempted to be installed during the npm install process, but if they fail to install, the installation process will not fail.

peerDependencies Record<string, string>

Specifies dependencies that are required by the package but are expected to be provided by the consumer of the package.

peerDependenciesMeta Record<string, object>

When a user installs your package, warnings are emitted if packages specified in "peerDependencies" are not already installed. The "peerDependenciesMeta" field serves to provide more information on how your peer dependencies are utilized. Most commonly, it allows peer dependencies to be marked as optional. Metadata for this field is specified with a simple hash of the package name to a metadata object.

bundleDependencies string[] | boolean

Array of package names that will be bundled when publishing the package.

bundledDependencies string[] | boolean

DEPRECATED: This field is honored, but "bundleDependencies" is the correct field name.

resolutions object

Resolutions is used to support selective version resolutions using yarn, which lets you define custom package versions or ranges inside your dependencies. For npm, use overrides instead. See: https://yarnpkg.com/configuration/manifest#resolutions

overrides object

Overrides is used to support selective version overrides using npm, which lets you define custom package versions or ranges inside your dependencies. For yarn, use resolutions instead. See: https://docs.npmjs.com/cli/v9/configuring-npm/package-json#overrides

packageManager string

Defines which package manager is expected to be used when working on the current project. This field is currently experimental and needs to be opted-in; see https://nodejs.org/api/corepack.html

pattern=(npm|pnpm|yarn|bun)@\d+\.\d+\.\d+(-.+)?
engines Record<string, string>
1 nested properties
node string
volta object

Defines which tools and versions are expected to be used when Volta is installed.

1 nested properties
extends string

The value of that entry should be a path to another JSON file which also has a "volta" section

engineStrict boolean
os string[]

Specify which operating systems your module will run on.

cpu string[]

Specify that your code only runs on certain cpu architectures.

devEngines object

Define the runtime and package manager for developing the current project.

5 nested properties

Specifies which operating systems are supported for development

Specifies which CPU architectures are supported for development

Specifies which C standard libraries are supported for development

Specifies which JavaScript runtimes (like Node.js, Deno, Bun) are supported for development. Values should use WinterCG Runtime Keys (see https://runtime-keys.proposal.wintercg.org/)

Specifies which package managers are supported for development

preferGlobal boolean

DEPRECATED: This option used to trigger an npm warning, but it will no longer warn. It is purely there for informational purposes. It is now recommended that you install any binaries as local devDependencies wherever possible.

private boolean | enum

If set to true, then npm will refuse to publish it.

publishConfig object
4 nested properties
access string
Values: "public" "restricted"
tag string
registry string
format=uri
provenance boolean
dist object
2 nested properties
shasum string
tarball string
readme string
module string

An ECMAScript module ID that is the primary entry point to your program.

esnext Record<string, string>

A module ID with untranspiled code that is the primary entry point to your program.

2 nested properties
main string
browser string
workspaces string[] | object

Allows packages within a directory to depend on one another using direct linking of local files. Additionally, dependencies within a workspace are hoisted to the workspace root when possible to reduce duplication. Note: It's also a good idea to set "private" to true when using this feature.

jspm
eslintConfig Latest Eslintrc
stylelint Latest Stylelintrc
jscpd Latest Jscpd
pnpm object

Defines pnpm specific configuration.

18 nested properties
overrides object

Used to override any dependency in the dependency graph.

packageExtensions object

Used to extend the existing package definitions with additional information.

peerDependencyRules object
3 nested properties
ignoreMissing string[]

pnpm will not print warnings about missing peer dependencies from this list.

allowedVersions object

Unmet peer dependency warnings will not be printed for peer dependencies of the specified range.

allowAny string[]

Any peer dependency matching the pattern will be resolved from any version, regardless of the range specified in "peerDependencies".

neverBuiltDependencies string[]

A list of dependencies to run builds for.

onlyBuiltDependencies string[]

A list of package names that are allowed to be executed during installation.

onlyBuiltDependenciesFile string

Specifies a JSON file that lists the only packages permitted to run installation scripts during the pnpm install process.

ignoredBuiltDependencies string[]

A list of package names that should not be built during installation.

allowedDeprecatedVersions object

A list of deprecated versions that the warnings are suppressed.

patchedDependencies object

A list of dependencies that are patched.

allowNonAppliedPatches boolean

When true, installation won't fail if some of the patches from the "patchedDependencies" field were not applied.

allowUnusedPatches boolean

When true, installation won't fail if some of the patches from the "patchedDependencies" field were not applied.

updateConfig object
1 nested properties
ignoreDependencies string[]

A list of packages that should be ignored when running "pnpm outdated" or "pnpm update --latest".

configDependencies object

Configurational dependencies are installed before all the other types of dependencies (before 'dependencies', 'devDependencies', 'optionalDependencies').

auditConfig object
2 nested properties
ignoreCves string[]

A list of CVE IDs that will be ignored by "pnpm audit".

ignoreGhsas string[]

A list of GHSA Codes that will be ignored by "pnpm audit".

requiredScripts string[]

A list of scripts that must exist in each project.

supportedArchitectures object

Specifies architectures for which you'd like to install optional dependencies, even if they don't match the architecture of the system running the install.

3 nested properties
os string[]
cpu string[]
libc string[]
ignoredOptionalDependencies string[]

A list of optional dependencies that the install should be skipped.

executionEnv object
1 nested properties
nodeVersion string

Specifies which exact Node.js version should be used for the project's runtime.

stackblitz object

Defines the StackBlitz configuration for the project.

4 nested properties
installDependencies boolean

StackBlitz automatically installs npm dependencies when opening a project.

startCommand string | boolean

A terminal command to be executed when opening the project, after installing npm dependencies.

compileTrigger string

The compileTrigger option controls how file changes in the editor are written to the WebContainers in-memory filesystem.

env object

A map of default environment variables that will be set in each top-level shell process.

Any of

1. object object
2. object object
3. object object

Definitions

person object | string

A person who has been involved in creating or maintaining this package.

name string required
url string
format=uri
email string
format=email
dependency Record<string, string>

Dependencies are specified with a simple hash of package name to version range. The version range is a string which has one or more space-separated descriptors. Dependencies can also be identified with a tarball or git URL.

devDependency Record<string, string>

Specifies dependencies that are required for the development and testing of the project. These dependencies are not needed in the production environment.

optionalDependency Record<string, string>

Specifies dependencies that are optional for your project. These dependencies are attempted to be installed during the npm install process, but if they fail to install, the installation process will not fail.

peerDependency Record<string, string>

Specifies dependencies that are required by the package but are expected to be provided by the consumer of the package.

peerDependencyMeta Record<string, object>

When a user installs your package, warnings are emitted if packages specified in "peerDependencies" are not already installed. The "peerDependenciesMeta" field serves to provide more information on how your peer dependencies are utilized. Most commonly, it allows peer dependencies to be marked as optional. Metadata for this field is specified with a simple hash of the package name to a metadata object.

license string | enum
scriptsInstallAfter string

Run AFTER the package is installed.

scriptsPublishAfter string

Run AFTER the package is published.

scriptsRestart string

Run by the 'npm restart' command. Note: 'npm restart' will run the stop and start scripts if no restart script is provided.

scriptsStart string

Run by the 'npm start' command.

scriptsStop string

Run by the 'npm stop' command.

scriptsTest string

Run by the 'npm test' command.

scriptsUninstallBefore string

Run BEFORE the package is uninstalled.

scriptsVersionBefore string

Run BEFORE bump the package version.

packageExportsEntryPath string | null

The module path that is resolved when this specifier is imported. Set to null to disallow importing this module.

packageExportsEntryObject object

Used to specify conditional exports, note that Conditional exports are unsupported in older environments, so it's recommended to use the fallback array option if support for those environments is a concern.

packageExportsEntry packageExportsEntryPath | packageExportsEntryObject
packageExportsFallback packageExportsEntry[]

Used to allow fallbacks in case this environment doesn't support the preceding entries.

packageExportsEntryOrFallback packageExportsEntry | packageExportsFallback
packageImportsEntryPath string | null

The module path that is resolved when this specifier is imported. Set to null to disallow importing this module.

packageImportsEntryObject object

Used to specify conditional exports, note that Conditional exports are unsupported in older environments, so it's recommended to use the fallback array option if support for those environments is a concern.

packageImportsEntry packageImportsEntryPath | packageImportsEntryObject
packageImportsFallback packageImportsEntry[]

Used to allow fallbacks in case this environment doesn't support the preceding entries.

packageImportsEntryOrFallback packageImportsEntry | packageImportsFallback
fundingUrl string

URL to a website with details about how to fund the package.

fundingWay object

Used to inform about ways to help fund development of the package.

url string required

URL to a website with details about how to fund the package.

format=uri
type string

The type of funding or the platform through which funding can be provided, e.g. patreon, opencollective, tidelift or github.

devEngineDependency object

Specifies requirements for development environment components such as operating systems, runtimes, or package managers. Used to ensure consistent development environments across the team.

name string required

The name of the dependency, with allowed values depending on the parent field

version string

The version range for the dependency

onFail string

What action to take if validation fails

Values: "ignore" "warn" "error" "download"