Skip to content
/ types Public

Typescript definitions for npm registry content

License

Notifications You must be signed in to change notification settings

npm/types

This branch is up to date with main.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

9780470 · Oct 7, 2024

History

37 Commits
Aug 29, 2024
Jul 24, 2024
Jul 24, 2024
Oct 7, 2024
Aug 29, 2024
May 8, 2024
May 8, 2024
Aug 29, 2024
May 6, 2024
Aug 13, 2024
Aug 13, 2024
May 6, 2024
May 6, 2024
Aug 30, 2018
May 8, 2024
Aug 29, 2024
Aug 29, 2024
May 7, 2024
May 8, 2024

Repository files navigation

@npm/types

Typescript definitions for npm registry endpoints

For example:

import * as npm from '@npm/types';

fetch('https://registry.npmjs.org/cookie')
  .then((res) => res.json())
  .then((obj: npm.Packument) => {
    // `obj` has proper registry types!
  })

Types

Packument

Response type for the https://registry.npmjs.org/:packageName endpoint

PackumentVersion

Response type for the https://registry.npmjs.org/:packageName/:packageVersion endpoint. Also the type of Packument['versions'] entries.

Manifest

Response type for the https://registry.npmjs.org/:packageName endpoint, when made with the 'Accept: application/vnd.npm.install-v1+json' header.

ManifestVersion

Response type for the https://registry.npmjs.org/:packageName/:packageVersion endpoint, when made with the 'Accept: application/vnd.npm.install-v1+json' header. Also the type of Manifest['versions'] entries.

PackageJSON

A "loose" definition of package.json structures.

Note

This is not an authoritative definition of package.json structures. Rather, it is a best-effort attempt to describe the fields that are de-facto standards for Node.js, npm, and TypeScript development.