简体   繁体   English

作用域包的npm注册表URL是什么?

[英]What's the npm registry URL for a scoped package?

There's an underlying API to npm - registry.npmjs.org (amongst others). npm有一个底层API -registry.npmjs.org(以及其他)。 The docs are here - https://github.com/npm/registry/blob/master/docs/REGISTRY-API.md 这些文档在这里-https: //github.com/npm/registry/blob/master/docs/REGISTRY-API.md

If I want to query a package (eg, express) then the URL is https://registry.npmjs.org/express/ . 如果我要查询包裹(例如快递),则URL为https://registry.npmjs.org/express/

However, if I want to query a scoped package (eg, @types/node), I can find it in the search endpoint ( https://registry.npmjs.org/-/v1/search?text=@types/node ), but when I hit https://registry.npmjs.org/@types/node I get a 404. 但是,如果我想查询一个有范围的包(例如@ types / node),我可以在搜索端点中找到它( https://registry.npmjs.org/-/v1/search?text=@types/node ),但是当我点击https://registry.npmjs.org/@types/node时,我得到了404。

As this is not documented, does anyone know what the URL is for public scoped packages? 由于没有记录,因此有人知道公共范围软件包的URL吗?

Perform url encoding for a scoped packages in npm repository. 对npm存储库中的作用域包执行url编码。

@types/node as @types%2Fnode

Exact URL https://registry.npmjs.org/@types%2Fnode 确切的网址https://registry.npmjs.org/@types%2Fnode

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM