Socket
Socket
Sign inDemoInstall

@npm/types

Package Overview
Dependencies
0
Maintainers
82
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @npm/types

Typescript definitions for npm registry content


Version published
Maintainers
82
Install size
24.2 kB
Created

Readme

Source

@npm/types

Typescript definitions for npm registry content

import * as npm from '@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

FAQs

Last updated on 06 May 2022

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc