node.js - npm 包元数据 api
问题描述
npm 说我们可以通过下面提供的公共 api 获取包的元数据
https://github.com/npm/registry/blob/master/docs/REPLICATE-API.md#get
https://github.com/npm/registry/blob/master/docs/REGISTRY-API.md#get-all
但是当我们从外部 Web 应用程序(假设 localhost)调用 api 时,它们似乎都不起作用。它给出了 cors 错误。
只有搜索 api 似乎是公开的
https://github.com/npm/registry/blob/master/docs/REGISTRY-API.md#get-v1search
谁能帮我找到公共 api,我们可以从中检索包的元数据。没有给出cors错误。
我也使用了下面列出的技术。但是当我们尝试从外部应用程序调用时,它们似乎都不起作用。它给出了 cors 错误 列出 npm 注册表中的所有公共包
解决方案
推荐阅读
- javascript - 由于相同的站点 cookie 规则,Twitter 嵌入无法在 Chrome 上运行
- ubuntu - pgAdmin 3 在尝试执行任意 sql 查询时崩溃
- python - 无法在多处理 python 中使用共享字典修改列表值
- javascript - HTML/Javascript 消息不会从动态表单输入/显示中持续存在
- python - 在 pytube 中添加进度条
- python - Python'for'循环随机停止
- html - 如何使用 HTML 从(iPhone - 本地存储)播放视频?
- ramda.js - 您将如何使用 Ro 编写 R.compose?
- c++ - 尝试将数组中的字符串转换为 char* 数组时出现段错误
- python - Python 和 AzureCosmosDB:命令中的查询必须针对单个分片键