Skip to content

ThotakuraHarish2003/npm-registry-sdk

 
 

Repository files navigation

npm-registry-sdk

version Maintenance OpenSSF Scorecard mit build

Node.js SDK to fetch data from the npm API.

Getting Started

This package is available in the Node Package Repository and can be easily installed with npm or yarn.

$ npm i @nodesecure/npm-registry-sdk
# or
$ yarn add @nodesecure/npm-registry-sdk

Usage example

import Registry from "@nodesecure/npm-registry-sdk";

API

getNpmRegistryURL(): string

getLocalRegistryURL(): string

setLocalRegistryURL(value: string | URL): string

loadRegistryURLFromLocalSystem(): string

metadata(): Promise<NpmRegistryMetadata>

interface NpmRegistryMetadata {
  db_name: string;
  doc_count: number;
  doc_del_count: number;
  update_seq: number;
  purge_seq: number;
  compact_running: boolean;
  disk_size: number;
  data_size: number;
  instance_start_time: string;
  disk_format_version: number;
  committed_update_seq: number;
}

packument(name: string, options?: PackumentOptions): Promise<npm.Packument>

interface PackumentOptions {
  token: string;
}

packumentVersion(name: string, version: string, options?: packumentOptions): Promise<npm.PackumentVersion>

downloads(pkgName: string, period: Period = "last-week"): Promise< NpmPackageDownload >

interface NpmPackageDownload {
  downloads: number;
  start: string;
  end: string;
  package: string;
}

Contributors ✨

All Contributors

Thanks goes to these wonderful people (emoji key):

Gentilhomme
Gentilhomme

💻 📖 👀 🛡️ 🐛
Quentin Lepateley
Quentin Lepateley

💻 📖 👀
Nicolas Hallaert
Nicolas Hallaert

📖
tekeuange23
tekeuange23

💻
Tony Gorez
Tony Gorez

💻
hiroki osame
hiroki osame

💻
Kouadio Fabrice Nguessan
Kouadio Fabrice Nguessan

🚧

License

MIT

About

Node.js SDK to fetch data from the npm API.

Resources

License

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 100.0%