https://github.com/npm/types
Typescript definitions for npm registry content
https://github.com/npm/types
npm-cli registry
Last synced: about 1 year ago
JSON representation
Typescript definitions for npm registry content
- Host: GitHub
- URL: https://github.com/npm/types
- Owner: npm
- License: mit
- Created: 2018-08-29T18:20:52.000Z (almost 8 years ago)
- Default Branch: main
- Last Pushed: 2024-12-12T06:10:37.000Z (over 1 year ago)
- Last Synced: 2025-03-29T06:06:34.479Z (about 1 year ago)
- Topics: npm-cli, registry
- Language: JavaScript
- Homepage:
- Size: 158 KB
- Stars: 27
- Watchers: 12
- Forks: 15
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Codeowners: .github/CODEOWNERS
- Security: SECURITY.md
Awesome Lists containing this project
README
# @npm/types
Typescript definitions for npm registry endpoints
For example:
```typescript
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.