当前位置:网站首页>Qiao NPMS: search for NPM packages
Qiao NPMS: search for NPM packages
2022-06-30 20:50:00 【uikoo9】

【 Preface 】
Another common requirement is to search for a npm package , Get the returned information , Similar to the above figure
【 Search for npm Package information 】
npm There is no official api, But there are encapsulated npm package ,
https://github.com/npm/cli/tree/latest/workspaces/libnpmsearch
This npm Package based on another npm package ,
GitHub - npm/npm-registry-fetch: like fetch() but for the npm registry
The latter is npm The foundation of several toolkits , Encapsulates the npm request api Related methods , If you are interested, you can have a look at
On search There are many packages at the same level , for example access,fund,hook etc.
See :https://github.com/npm/cli/tree/latest/workspaces

【qiao-npms】
Encapsulates the search Related methods , Pass in the package name ,
Default limit 了 3 Item return , Sort by popularity , You can also introduce it yourself options
'use strict';
var q = require('qiao-npms');
var test = async function(){
try{
var packageName = 'qiao-cos';
var res = await q.searchPackages(packageName);
console.log(res);
}catch(e){
console.log(e);
}
};
test();return
[
{
name: 'qiao-cos',
scope: 'unscoped',
version: '0.4.3',
description: 'tencent cos upload tool on nodejs',
keywords: [ 'tencent', 'cos', 'upload', 'tool', 'nodejs' ],
date: 2022-06-13T08:06:26.354Z,
links: {
npm: 'https://www.npmjs.com/package/qiao-cos',
homepage: 'https://github.com/uikoo9/qiao-monorepo/tree/master/packages/qiao-cos#readme',
repository: 'https://github.com/uikoo9/qiao-monorepo',
bugs: 'https://github.com/uikoo9/qiao-monorepo/issues'
},
author: { name: 'uikoo9', email: '[email protected]' },
publisher: { username: 'npm_insistime', email: '[email protected]' },
maintainers: [ [Object] ]
}
]【 Get package Downloads 】
qiao-npms, It also encapsulates the method of obtaining the download amount of a certain package ,
See :qiao-npms: obtain npm Package downloads _uikoo9 The blog of -CSDN Blog
【 summary 】
1.qiao-npms, Search for npm Package information
2.qiao-npms, Get package Downloads
边栏推荐
猜你喜欢

谈谈内联函数

Binary search tree (1) - concept and C language implementation

Label Contrastive Coding based Graph Neural Network for Graph Classification

MFC界面库BCGControlBar v33.0 - 桌面警报窗口、网格控件升级等
![[1175. prime number arrangement]](/img/f2/d427db03da151786ea1dfb7a76328a.png)
[1175. prime number arrangement]

Failed to configure a DataSource: ‘url‘ attribute is not specified and no embedded datasource could

阿里kube-eventer mysql sink简单使用记录

Lumiprobe 改性三磷酸盐丨生物素-11-UTP研究

Maya house modeling

All the important spark summit features were released here last night (with ultra clear video attached)
随机推荐
STL的基本组成部分
哈夫曼樹(一)基本概念與C語言實現
B_QuRT_User_Guide(33)
Lumiprobe染料 NHS 酯丨BDP FL NHS 酯研究
Peking University ACM problems 1003:hangover
Lumiprobe生物素亚磷酰胺(羟脯氨酸)说明书
微信小程序怎么实现圆心进度条
Implementation principle of PostgreSQL heap table storage engine
Lumiprobe biotin phosphimide (hydroxyproline) instructions
Testing principle and precautions of biovendor rage ELISA Kit
CentOS - enable / disable Oracle
北京大学ACM Problems 1001:Exponentiation
uniapp-富文本编辑器
uniapp怎么上传二进制图片
Lumiprobe copper free click chemical solution
How do I get the largest K massive data
转:用实际行动赢得别人追随
B_QuRT_User_Guide(35)
Huffman tree (I) basic concept and C language implementation
片荒吗?不用下载直接在线免费看的资源来了!2022年收藏夹必须有它!