当前位置:网站首页>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
边栏推荐
- Qt和其它GUI库的对比
- Basic concepts of tree
- 断点续传和下载原理分析
- 数据库 OLAP、OLTP是什么?相同和不同?适用场景
- Huffman Tree (1) Basic Concept and C - language Implementation
- SQL必需掌握的100个重要知识点:创建和操纵表
- Failed to configure a DataSource: ‘url‘ attribute is not specified and no embedded datasource could
- 关于,奇安信检测代码漏洞,XSS系列解决
- 毕业设计
- Lumiprobe细胞生物学丨DiA,亲脂性示踪剂说明书
猜你喜欢

软工UML画图

Is the project manager a leader? Can you criticize and blame members?

Testing principle and precautions of biovendor rage ELISA Kit

Lambda expression principle analysis and learning (June 23, 2022)

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

Document contains & conditional competition

MySQL:SQL概述及数据库系统介绍 | 黑马程序员

RP原型资源分享-购物类App

微信小程序怎么实现圆心进度条

为什么vscode用久了电脑速度变慢?
随机推荐
Study on lumiprobe dye NHS ester BDP FL NHS ester
RP原型资源分享-购物类App
基于开源流批一体数据同步引擎ChunJun数据还原—DDL解析模块的实战分享
Go language identifier and package name specification
Testing principle and precautions of biovendor rage ELISA Kit
vncserver: Failed command ‘/etc/X11/Xvnc-session‘: 256!
Lumiprobe biotin phosphimide (hydroxyproline) instructions
On inline function
亚马逊在阿拉伯联合酋长国限制LGBTQ相关的搜索和产品销售
PHP obtains opcode and C source code
Vite2兼容低版本chrome(如搜狗80),通过polyfills处理部分需求高版本的语法
By analyzing more than 7million R & D needs, it is found that these eight programming languages are the most needed by the industry
Maya house modeling
Is the project manager a leader? Can you criticize and blame members?
obsidian配合hugo的使用,让markdown本地编辑软件与在线化无缝衔接
【微服务~Nacos】Nacos之配置中心
北京大学ACM Problems 1004:Financial Management
数据库 OLAP、OLTP是什么?相同和不同?适用场景
北京大学ACM Problems 1000:A+B Problem
Description of the latest RTSP address rules for Hikvision camera, NVR, streaming media server, playback and streaming [easy to understand]