{"id":14007114,"url":"https://github.com/NodeSecure/npm-registry-sdk","last_synced_at":"2025-07-24T01:30:44.883Z","repository":{"id":37035436,"uuid":"374116082","full_name":"NodeSecure/npm-registry-sdk","owner":"NodeSecure","description":"Node.js SDK to fetch data from the npm API.","archived":false,"fork":false,"pushed_at":"2024-04-01T00:43:39.000Z","size":384,"stargazers_count":9,"open_issues_count":3,"forks_count":9,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-04-26T01:32:12.916Z","etag":null,"topics":["npm","registry","sdk"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/NodeSecure.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-06-05T13:04:33.000Z","updated_at":"2024-06-18T21:27:57.353Z","dependencies_parsed_at":"2023-12-12T12:25:41.912Z","dependency_job_id":"4621bdc0-9148-4a61-88d8-041e0d69f212","html_url":"https://github.com/NodeSecure/npm-registry-sdk","commit_stats":{"total_commits":75,"total_committers":15,"mean_commits":5.0,"dds":"0.42666666666666664","last_synced_commit":"9c3dab1c21b030e9942aac38993c9a9cdd723aaf"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NodeSecure%2Fnpm-registry-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NodeSecure%2Fnpm-registry-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NodeSecure%2Fnpm-registry-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NodeSecure%2Fnpm-registry-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NodeSecure","download_url":"https://codeload.github.com/NodeSecure/npm-registry-sdk/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227295133,"owners_count":17759957,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["npm","registry","sdk"],"created_at":"2024-08-10T10:01:50.139Z","updated_at":"2024-11-30T17:31:56.854Z","avatar_url":"https://github.com/NodeSecure.png","language":"TypeScript","readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://github-production-user-asset-6210df.s3.amazonaws.com/4438263/265200236-271ccda6-82b9-457a-956b-2cb855e2ff68.jpg\" alt=\"@nodesecure/npm-registry-sdk\"\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://github.com/NodeSecure/npm-registry-sdk\"\u003e\n      \u003cimg src=\"https://img.shields.io/badge/dynamic/json.svg?style=for-the-badge\u0026url=https://raw.githubusercontent.com/NodeSecure/npm-registry-sdk/master/package.json\u0026query=$.version\u0026label=Version\" alt=\"npm version\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://github.com/NodeSecure/npm-registry-sdk/graphs/commit-activity\"\u003e\n      \u003cimg src=\"https://img.shields.io/badge/Maintained%3F-yes-green.svg?style=for-the-badge\" alt=\"maintenance\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://github.com/NodeSecure/npm-registry-sdk/blob/master/LICENSE\"\u003e\n      \u003cimg src=\"https://img.shields.io/github/license/NodeSecure/npm-registry-sdk.svg?style=for-the-badge\" alt=\"license\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://api.securityscorecards.dev/projects/github.com/NodeSecure/npm-registry-sdk\"\u003e\n      \u003cimg src=\"https://api.securityscorecards.dev/projects/github.com/NodeSecure/npm-registry-sdk/badge?style=for-the-badge\" alt=\"ossf scorecard\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://github.com/NodeSecure/npm-registry-sdk/actions?query=workflow%3A%22Node.js+CI%22\"\u003e\n      \u003cimg src=\"https://img.shields.io/github/actions/workflow/status/NodeSecure/npm-registry-sdk/node.js.yml?style=for-the-badge\" alt=\"github ci workflow\"\u003e\n    \u003c/a\u003e\n\u003c/p\u003e\n\nNode.js SDK to fetch data from the npm API (with up to date TypeScript types)\n\n## Getting Started\n\nThis package is available in the Node Package Repository and can be easily installed with [npm](https://docs.npmjs.com/getting-started/what-is-npm) or [yarn](https://yarnpkg.com).\n\n```bash\n$ npm i @nodesecure/npm-registry-sdk\n# or\n$ yarn add @nodesecure/npm-registry-sdk\n```\n\n## Usage example\n\n```ts\nimport * as Npm from \"@nodesecure/npm-registry-sdk\";\n\nconst packument: Npm.Packument = await Npm.packument(\"express\");\nconsole.log(packument);\n```\n\n\u003ckbd\u003epackument\u003c/kbd\u003e and \u003ckbd\u003epackumentVersion\u003c/kbd\u003e take an optional payload options which can be used to provide an NPM token.\n\n```ts\nimport * as Npm from \"@nodesecure/npm-registry-sdk\";\n\nconst user: NpmUserProfile = await Npm.user(\"test-user\");\nconsole.log(user);\n```\n\n\u003ckbd\u003euser\u003c/kbd\u003e takes an optional payload pagination which can be used to set page number and page size to be used for paginated properties of the user like \u003ckbd\u003epacakges\u003c/kbd\u003e.\n## API\n\n### getNpmRegistryURL(): string\n\n### getLocalRegistryURL(): string\n\n### setLocalRegistryURL(value: string | URL): string\n\n### loadRegistryURLFromLocalSystem(mixins?: LoadRegistryMixins): string\n\n```ts\ninterface LoadRegistryMixins {\n  spawn?: typeof spawnSync;\n}\n```\n\n### metadata(): Promise\\\u003cNpmRegistryMetadata\u003e\n\n```ts\ninterface NpmRegistryMetadata {\n  db_name: string;\n  doc_count: number;\n  doc_del_count: number;\n  update_seq: number;\n  purge_seq: number;\n  compact_running: boolean;\n  disk_size: number;\n  data_size: number;\n  instance_start_time: string;\n  disk_format_version: number;\n  committed_update_seq: number;\n}\n```\n\n### packument(name: string, options?: PackumentOptions): Promise\\\u003cPackument\u003e\n\n```ts\ninterface Packument {\n  _id: string;\n  _rev: string;\n  name: string;\n  readme?: string;\n  description?: string;\n  'dist-tags': { latest?: string } \u0026 ObjectOfStrings;\n  versions: {\n    [key: string]: PackumentVersion\n  };\n  maintainers: Maintainer[];\n  time: {\n    modified: string,\n    created: string,\n    [key: string]: string\n  };\n  users?: {\n    [key: string]: boolean;\n  }\n  contributors?: Maintainer[];\n  homepage?: string;\n  keywords?: string[];\n  repository?: Repository;\n  author?: Maintainer;\n  bugs?:  { url: string };\n  license: string;\n  // left out users (stars) deprecated, and attachments (does nothing)\n  readmeFilename?: string;\n}\n```\n\n### packumentVersion(name: string, version: string, options?: PackumentOptions): Promise\\\u003cPackumentVersion\u003e\n\n```ts\ntype PackumentVersion = PackageJson \u0026 {\n  gitHead?: string;\n  maintainers: Maintainer[];\n  dist: Dist;\n  types?: string;\n  deprecated?: string;\n  _id: string;\n  _npmVersion: string;\n  _nodeVersion: string;\n  _npmUser: Maintainer;\n  _hasShrinkwrap?: boolean;\n  _engineSupported?: boolean;\n  _defaultsLoaded?: boolean;\n  _npmOperationalInternal?: {\n    host: string;\n    tmp: string;\n  }\n};\n```\n\n### downloads(pkgName: string, period: Period = \"last-week\"): Promise\u003c NpmPackageDownload \u003e\n\n```ts\ninterface NpmPackageDownload {\n  downloads: number;\n  start: string;\n  end: string;\n  package: string;\n}\n```\n\n### user(username: string, pagination: Partial\u003c Pagination \u003e = {}): Promise\u003c NpmUserProfile \u003e\n\n```ts\ninterface Pagination {\n  perPage: number;\n  page: number;\n}\n\ninterface NpmPackage {\n  id: number;\n  name: string;\n  description: string;\n  maintainers: string[];\n  version: string;\n}\n\ninterface NpmUserProfile {\n  id: number;\n  name: string;\n  fullname?: string;\n  accounts: {\n    twitter?: string;\n    github?: string;\n  };\n  avatars: {\n    small: string;\n    medium: string;\n    large: string;\n  };\n  packages: {\n    total: number;\n    objects: NpmPackage[];\n    urls: {\n      next: string;\n      prev: string;\n    }\n  };\n  pagination: Pagination;\n}\n```\n\n## Contributors ✨\n\n\u003c!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section --\u003e\n[![All Contributors](https://img.shields.io/badge/all_contributors-9-orange.svg?style=flat-square)](#contributors-)\n\u003c!-- ALL-CONTRIBUTORS-BADGE:END --\u003e\n\nThanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --\u003e\n\u003c!-- prettier-ignore-start --\u003e\n\u003c!-- markdownlint-disable --\u003e\n\u003ctable\u003e\n  \u003ctbody\u003e\n    \u003ctr\u003e\n      \u003ctd align=\"center\" valign=\"top\" width=\"14.28%\"\u003e\u003ca href=\"https://www.linkedin.com/in/thomas-gentilhomme/\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/4438263?v=4?s=100\" width=\"100px;\" alt=\"Gentilhomme\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eGentilhomme\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/NodeSecure/npm-registry-sdk/commits?author=fraxken\" title=\"Code\"\u003e💻\u003c/a\u003e \u003ca href=\"https://github.com/NodeSecure/npm-registry-sdk/commits?author=fraxken\" title=\"Documentation\"\u003e📖\u003c/a\u003e \u003ca href=\"https://github.com/NodeSecure/npm-registry-sdk/pulls?q=is%3Apr+reviewed-by%3Afraxken\" title=\"Reviewed Pull Requests\"\u003e👀\u003c/a\u003e \u003ca href=\"#security-fraxken\" title=\"Security\"\u003e🛡️\u003c/a\u003e \u003ca href=\"https://github.com/NodeSecure/npm-registry-sdk/issues?q=author%3Afraxken\" title=\"Bug reports\"\u003e🐛\u003c/a\u003e\u003c/td\u003e\n      \u003ctd align=\"center\" valign=\"top\" width=\"14.28%\"\u003e\u003ca href=\"https://github.com/QuentinLpy\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/31780359?v=4?s=100\" width=\"100px;\" alt=\"Quentin Lepateley\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eQuentin Lepateley\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/NodeSecure/npm-registry-sdk/commits?author=QuentinLpy\" title=\"Code\"\u003e💻\u003c/a\u003e \u003ca href=\"https://github.com/NodeSecure/npm-registry-sdk/commits?author=QuentinLpy\" title=\"Documentation\"\u003e📖\u003c/a\u003e \u003ca href=\"https://github.com/NodeSecure/npm-registry-sdk/pulls?q=is%3Apr+reviewed-by%3AQuentinLpy\" title=\"Reviewed Pull Requests\"\u003e👀\u003c/a\u003e\u003c/td\u003e\n      \u003ctd align=\"center\" valign=\"top\" width=\"14.28%\"\u003e\u003ca href=\"https://github.com/Rossb0b\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/39910164?v=4?s=100\" width=\"100px;\" alt=\"Nicolas Hallaert\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eNicolas Hallaert\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/NodeSecure/npm-registry-sdk/commits?author=Rossb0b\" title=\"Documentation\"\u003e📖\u003c/a\u003e\u003c/td\u003e\n      \u003ctd align=\"center\" valign=\"top\" width=\"14.28%\"\u003e\u003ca href=\"https://github.com/tekeuange23\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/35274201?v=4?s=100\" width=\"100px;\" alt=\"tekeuange23\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003etekeuange23\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/NodeSecure/npm-registry-sdk/commits?author=tekeuange23\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n      \u003ctd align=\"center\" valign=\"top\" width=\"14.28%\"\u003e\u003ca href=\"http://tonygo.dev\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/22824417?v=4?s=100\" width=\"100px;\" alt=\"Tony Gorez\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eTony Gorez\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/NodeSecure/npm-registry-sdk/commits?author=tony-go\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n      \u003ctd align=\"center\" valign=\"top\" width=\"14.28%\"\u003e\u003ca href=\"https://hirok.io\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/1075694?v=4?s=100\" width=\"100px;\" alt=\"hiroki osame\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003ehiroki osame\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/NodeSecure/npm-registry-sdk/commits?author=privatenumber\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n      \u003ctd align=\"center\" valign=\"top\" width=\"14.28%\"\u003e\u003ca href=\"https://github.com/fabnguess\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/72697416?v=4?s=100\" width=\"100px;\" alt=\"Kouadio Fabrice Nguessan\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eKouadio Fabrice Nguessan\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"#maintenance-fabnguess\" title=\"Maintenance\"\u003e🚧\u003c/a\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd align=\"center\" valign=\"top\" width=\"14.28%\"\u003e\u003ca href=\"https://github.com/PierreDemailly\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/39910767?v=4?s=100\" width=\"100px;\" alt=\"PierreDemailly\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003ePierreDemailly\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/NodeSecure/npm-registry-sdk/commits?author=PierreDemailly\" title=\"Code\"\u003e💻\u003c/a\u003e \u003ca href=\"https://github.com/NodeSecure/npm-registry-sdk/commits?author=PierreDemailly\" title=\"Documentation\"\u003e📖\u003c/a\u003e \u003ca href=\"https://github.com/NodeSecure/npm-registry-sdk/commits?author=PierreDemailly\" title=\"Tests\"\u003e⚠️\u003c/a\u003e\u003c/td\u003e\n      \u003ctd align=\"center\" valign=\"top\" width=\"14.28%\"\u003e\u003ca href=\"https://github.com/kishore881\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/49707819?v=4?s=100\" width=\"100px;\" alt=\"Kishore\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eKishore\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/NodeSecure/npm-registry-sdk/commits?author=kishore881\" title=\"Code\"\u003e💻\u003c/a\u003e \u003ca href=\"https://github.com/NodeSecure/npm-registry-sdk/commits?author=kishore881\" title=\"Tests\"\u003e⚠️\u003c/a\u003e \u003ca href=\"https://github.com/NodeSecure/npm-registry-sdk/commits?author=kishore881\" title=\"Documentation\"\u003e📖\u003c/a\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n  \u003c/tbody\u003e\n\u003c/table\u003e\n\n\u003c!-- markdownlint-restore --\u003e\n\u003c!-- prettier-ignore-end --\u003e\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:END --\u003e\n\n## License\n\nMIT\n","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FNodeSecure%2Fnpm-registry-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FNodeSecure%2Fnpm-registry-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FNodeSecure%2Fnpm-registry-sdk/lists"}