Skip to content

Latest commit

 

History

History
109 lines (82 loc) · 5.95 KB

README.md

File metadata and controls

109 lines (82 loc) · 5.95 KB

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