package.json

The JSON file at the root of every JavaScript package that records its name, version, dependencies, entry points and other settings.

In more detail

npm reads it to install dependencies and run scripts, and tools such as Node.js, bundlers and TypeScript read fields such as type and exports to decide which file to load. The type field decides whether .js files are treated as CommonJS or ES modules.

Related terms

Taught in

References