{"id":13549294,"url":"https://github.com/rvagg/npm-download-counts","last_synced_at":"2025-07-26T03:08:16.244Z","repository":{"id":9516474,"uuid":"11413593","full_name":"rvagg/npm-download-counts","owner":"rvagg","description":" Fetch package download counts for packages from the npm registry","archived":false,"fork":false,"pushed_at":"2019-06-18T12:48:22.000Z","size":20,"stargazers_count":12,"open_issues_count":1,"forks_count":6,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-05T14:58:49.929Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rvagg.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-07-15T03:08:22.000Z","updated_at":"2022-05-14T08:27:21.000Z","dependencies_parsed_at":"2022-09-18T12:30:46.323Z","dependency_job_id":null,"html_url":"https://github.com/rvagg/npm-download-counts","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/rvagg/npm-download-counts","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rvagg%2Fnpm-download-counts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rvagg%2Fnpm-download-counts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rvagg%2Fnpm-download-counts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rvagg%2Fnpm-download-counts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rvagg","download_url":"https://codeload.github.com/rvagg/npm-download-counts/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rvagg%2Fnpm-download-counts/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267109973,"owners_count":24037629,"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","status":"online","status_checked_at":"2025-07-26T02:00:08.937Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2024-08-01T12:01:20.318Z","updated_at":"2025-07-26T03:08:16.223Z","avatar_url":"https://github.com/rvagg.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"npm-download-counts\n===================\n\nFetch package download counts for packages from the npm registry\n----------------------------------------------------------------\n\n```js\nconst moment = require('moment')\nconst downloadCounts = require('npm-download-counts')\n\nconst pkg = 'levelup'\nconst start = moment().subtract('months', 1).toDate() // start date for lookup\nconst end = new Date() // end date for lookup\n\nlet data = await downloadCounts(pkg, start, end)\n// `data` is an array of objects with `day` and `count` properties\n// each element of the array represents a day in your date range\ndata.forEach(function (d, i) {\n  console.log(`On ${d.day}, ${pkg} was downloaded ~${d.count} times`)\n})\n```\n\nGives you something like:\n\n```\nOn 2013-06-15, levelup was downloaded ~91 times\nOn 2013-06-16, levelup was downloaded ~47 times\nOn 2013-06-17, levelup was downloaded ~57 times\nOn 2013-06-18, levelup was downloaded ~141 times\n...\n```\n\n* To make authenticated calls, supply a token from an npm account as the 4th argument.\n* If you supply a callback as the last argument, it won't return a `Promise` and can be used in standard error-first callback style.\n\n\u003ca name=\"collaborators\"\u003e\u003c/a\u003e\nCollaborators\n-------------\n\n * Rod Vagg [@rvagg] (https://github.com/rvagg)\n * Dav Glass [@davglass](https://github.com/davglass)\n\n\u003ca name=\"licence\"\u003e\u003c/a\u003e\nLicence \u0026amp; copyright\n-------------------\n\nCopyright (c) 2014 Rod Vagg\n\nnpm-download-counts is licensed under an MIT license. All rights not explicitly granted in the MIT license are reserved. See the included LICENSE file for more details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frvagg%2Fnpm-download-counts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frvagg%2Fnpm-download-counts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frvagg%2Fnpm-download-counts/lists"}