Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@npm/types

npm98.7kMIT2.0.0TypeScript support: included

Typescript definitions for npm registry content

npm registry, types, typescript, definitions, typings

readme

@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.

changelog

Changelog

2.0.0 (2024-08-07)

⚠️ BREAKING CHANGES

  • update types (#29)
  • refactor to use @npmcli/template-oss (#31)

Features

  • 123bb67 #29 update types (#29) (@broofa, @jablko, @lukekarrys)
  • f09f754 #31 refactor to use @npmcli/template-oss (#31) (@lukekarrys)

Bug Fixes

  • 6ffee7f #60 add missing fields, fix up array type, add comments (#60) (@broofa, @styfle)
  • 4548f2c #39 linting cleanup (#39) (@lukekarrys)

Documentation

  • 5511d4b #40 fix README typo, improve PackageJSON description (#40) (@broofa, @styfle)
  • 1a08144 #37 fix typo in readme (#37) (@lukekarrys)

Chores

  • d323311 #70 bump @types/node from 20.12.10 to 22.1.0 (#70) (@dependabot[bot])
  • 4761562 #71 bump @typescript-eslint/parser from 7.18.0 to 8.0.1 (#71) (@dependabot[bot])
  • 3687a18 #38 simplify template-oss config (#38) (@lukekarrys)
  • 1a1fd85 #36 remove build script and update snapshots and tsconfig (#36) (@lukekarrys)
  • 3172a32 update template-oss files for main branch (@lukekarrys)