Skip to content
forked from npm/types

Typescript definitions for npm registry content

License

Notifications You must be signed in to change notification settings

qiwi-forks/npm-types

This branch is 6 commits ahead of, 23 commits behind npm/types:main.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

f20f376 · Jul 1, 2021

History

20 Commits
Aug 30, 2018
Dec 3, 2020
Aug 30, 2018
Dec 3, 2020
Dec 3, 2020
Dec 3, 2020
Dec 3, 2020
Jul 1, 2021
Aug 30, 2018
Dec 3, 2020
Jul 1, 2021
Jul 1, 2021
Jul 1, 2021
Aug 30, 2018

Repository files navigation

@qiwi/npm-types

The fork of npm/types that fixes the most vulnerabilities and brings deps from 2020

Typescript definitions for npm registry content

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

const pkg = require('pacote');

pkg.packument('libnpm').then((obj: npm.Packument) => {
  console.log(obj.name, 'is the name of the package');
});

GOAL

Make it easier for typescript users to work with npm registry content!

vscode tooltip screenshot

Types should have comments so documentation on npm object properties can appear in vscode contextual popups.

types

  • npm.PackageJson

    • the object in the json file you have in your project
  • npm.PackageLock

    • the file generated for you by npm that pins your deps.
  • npm.Packument

    • the document you get from https://registry.npmjs.org/<package name here>
  • npm.Manifest

    • the document you get from curl -H 'accept:application/vnd.npm.install-v1+json' https://registry.npmjs.org/<package name here>

subtypes

  • npm.PackageVersion

    • the objects in the version fields of Packuments
  • npm.LockDependency

    • how package locks describe dependencies and sub dependencies
  • npm.ManifestVersion

    • the version object in an AbbreviatedPackument
  • npm.Dist

    • the object in npm.PackageVersion that holds the tarball location and checksums
  • npm.NpmScripts

    • helpful object with all of the possible npm hooks
  • npm.Maintainer

    • common type for author, maintainers etc used in many objects
  • npm.Repository

    • string or object of repo data

About

Typescript definitions for npm registry content

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 66.3%
  • JavaScript 33.7%