当前位置:网站首页>Qiao NPMS: get the download volume of NPM packages
Qiao NPMS: get the download volume of NPM packages
2022-06-11 08:23:00 【uikoo9】
【 Preface 】
A common requirement is to get something npm Package Downloads ,
Yes, of course npm The official website enters a npm Package details page ,
But when you maintain multiple npm When the package , It's more troublesome
【 obtain npm Package downloads 】
npm The official has access to a npm The opening of package downloads api, See :
registry/download-counts.md at master · npm/registry · GitHub
adopt get Request this interface
GET https://api.npmjs.org/downloads/point/{period}[/{package}]There are two parameters
period, Time range , Common are last-day,last-week,last-month etc.
package, The package name you want to query

【qiao-npms】
Will be common last-day,last-week,last-month Do the packaging , See :
downloadCountsLastDay
'use strict';
var q = require('qiao-npms');
var test = async function(){
try{
var packageName = 'qiao-cos';
var res = await q.downloadCountsLastDay(packageName);
console.log(res);
}catch(e){
console.log(e);
}
};
test();return
{
downloads: 0,
start: '2022-06-08',
end: '2022-06-08',
package: 'qiao-cos'
}downloadCountsLastWeek
'use strict';
var q = require('qiao-npms');
var test = async function(){
try{
var packageName = 'qiao-cos';
var res = await q.downloadCountsLastWeek(packageName);
console.log(res);
}catch(e){
console.log(e);
}
};
test();return
{
downloads: 80,
start: '2022-06-02',
end: '2022-06-08',
package: 'qiao-cos'
}downloadCountsLastMonth
'use strict';
var q = require('qiao-npms');
var test = async function(){
try{
var packageName = 'qiao-cos';
var res = await q.downloadCountsLastMonth(packageName);
console.log(res);
}catch(e){
console.log(e);
}
};
test();return
{
downloads: 763,
start: '2022-05-10',
end: '2022-06-08',
package: 'qiao-cos'
}downloadCounts
'use strict';
var q = require('qiao-npms');
var test = async function(){
try{
var packageName = 'qiao-cos';
var res = await q.downloadCounts(packageName, 'last-day');
console.log(res);
}catch(e){
console.log(e);
}
};
test();return
{
downloads: 0,
start: '2022-06-08',
end: '2022-06-08',
package: 'qiao-cos'
}【qiao-lerna】
qiao-npms It is a tool to obtain the download volume of a single package ,
If you want to count multiple npm The amount of package downloads can be used qiao-lerna,
Usage method , See :
https://uikoo9.blog.csdn.net/article/details/125215862
【 summary 】
1.qiao-npms, Easy access npm Package downloads
2.qiao-lerna, Batch acquisition npm Package downloads
边栏推荐
- Summary of embedded software interview questions
- Layout of code setting constraintlayout_ constraintDimensionRatio
- Jupyter notebook code completion plug-in + Solution
- 进程控制:进程等待(回收子进程)
- qiao-npms:获取npm包下载量
- Logical implication of functional dependence
- bat 批处理单独环境打包
- Dameng database startup and shutdown
- JS basic learning script
- Timestamp of PostgreSQL and Oracle
猜你喜欢

Process control: process waiting (recycling child processes)

2022.6.6 extra long growth simulation

Method summary of creating deep learning model with keras/tensorflow 2.9

Mongodb--- automatically delete expired data using TTL index
![Socket [5] - struct linker usage](/img/e5/bce5d89c61a3a4f89171734ca6ff8e.png)
Socket [5] - struct linker usage

如何开始参与开源社区

node报错整理

Crawl Baidu Baipin dynamic page

使用 COCO 数据集训练 YOLOv4-CSP 模型

Xshell7 and xftp7 to continue using this program, you must apply the latest updates or use a new version
随机推荐
qiao-lerna:lerna辅助工具
Project training - clonemon
Typescript class and interface, class and generic, interface merging
Dameng user management
Typescript declaration merge
860. lemonade change
JS learning basics document Write write a line of text in the page
嵌入式软件面试问题总结
DAMENG 数据库登陆
Bat batch processing separate environment packaging
torch. unbind()
uniapp关闭/开启/调节系统声音
这几个小工具也太好用了
TRUNC in pytorch_ normal_ principle
Modulenotfounderror: no module named 'tensorboard in pytorch‘
Socket [5] - struct linker usage
Interfaces and abstract classes
字符设备驱动程序之异步通知机制
TypeScript-unknown类型
Return in foreach and break in for