Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

npm-registry-client

Package Overview
Dependencies
Maintainers
1
Versions
156
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

npm-registry-client

Client for the npm registry

  • 8.3.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
247K
increased by12.67%
Maintainers
1
Weekly downloads
 
Created

What is npm-registry-client?

The npm-registry-client package is a client for interacting with the npm registry. It allows you to perform various operations such as fetching package metadata, publishing packages, and managing package versions.

What are npm-registry-client's main functionalities?

Fetching Package Metadata

This feature allows you to fetch metadata for a specific package from the npm registry. The code sample demonstrates how to fetch metadata for the 'npm' package.

const NpmRegistryClient = require('npm-registry-client');
const client = new NpmRegistryClient();
const uri = 'https://registry.npmjs.org/npm';
client.get(uri, {}, (error, data, raw, res) => {
  if (error) {
    console.error(error);
  } else {
    console.log(data);
  }
});

Publishing a Package

This feature allows you to publish a package to the npm registry. The code sample demonstrates how to publish a package named 'my-package' with version '1.0.0'.

const NpmRegistryClient = require('npm-registry-client');
const client = new NpmRegistryClient();
const uri = 'https://registry.npmjs.org/npm';
const params = { metadata: { name: 'my-package', version: '1.0.0' }, access: 'public' };
client.publish(uri, params, (error, data) => {
  if (error) {
    console.error(error);
  } else {
    console.log('Package published successfully');
  }
});

Managing Package Versions

This feature allows you to manage and list the available versions of a package. The code sample demonstrates how to list all available versions of the 'npm' package.

const NpmRegistryClient = require('npm-registry-client');
const client = new NpmRegistryClient();
const uri = 'https://registry.npmjs.org/npm';
client.get(uri, {}, (error, data) => {
  if (error) {
    console.error(error);
  } else {
    console.log('Available versions:', Object.keys(data.versions));
  }
});

Other packages similar to npm-registry-client

FAQs

Package last updated on 27 Apr 2017

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc