当前位置:网站首页>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
边栏推荐
- Layout of code setting constraintlayout_ constraintDimensionRatio
- How to do well in empty state design? Look at this comprehensive summary
- TypeScript-接口和类型别名异同
- Development of sylixos SD device driver
- torch. unbind()
- Typescript class and interface, class and generic, interface merging
- Entity class conversion cannot be reassigned
- Planning tasks for continuous automated testing
- TypeScript-unknown类型
- Summary of embedded software interview questions
猜你喜欢

TRUNC in pytorch_ normal_ principle

These gadgets are also very easy to use

Sign in system design: how to draw the sign in function

Node error report sorting

(the slow download speed of cifar10 in torchvision has been solved) how to download and use torchvision import

XXL task executor calls local project

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

Magnifying mirror rendering

怎么做好项目管理?学会这4个步骤就够了

Process control: process waiting (recycling child processes)
随机推荐
qiao-npms:获取npm包下载量
Deep understanding of add in argparse module_ Argument parameters (such as action)
bat 批处理单独环境打包
Layout of code setting constraintlayout_ constraintDimensionRatio
Selenium click the floating menu and realize the functions of right mouse button
Typescript namespace
Uniapp turn off / on / adjust system sound
Introduction to the principles of linkedblockingqueue, arrayblockingqueue, synchronousqueue, concurrentlinkedqueue and transferqueue
Typescript type protection
In an activity, view postdelay will cause memory leakage, but will not affect the life cycle execution of the activity.
uniapp 插件开发
Post - payload of interface test
字符设备驱动程序之异步通知机制
How to find the complementary sequence of digraph
(taking pytorch as an example) a simple understanding of the regularization method of path (depth) -drop path
Process control: process waiting (recycling child processes)
Scrape captures 51job Recruitment Information (static page)
Solve cannot import name 'multiheadattention' from 'tensorflow keras. layers‘
ICML2022有意思的文章
qiao-lerna:lerna辅助工具