javascript - Third party libraries of Deno having package.json?
问题描述
Correct me if I'm wrong but Deno should not understand the concept of package.json
nor node_modules
, if that's the case, why there are couple of third party libraries such as lodash, dayjs still having package.json
in their repo?
解决方案
I can provide some historical context here; The first version of the deno.land/x
registry worked by having a list of repositories that was kept directly in the GitHub repository, anyone could submit a PR to add any other public repository to that list and copied over to deno.land/x
. As the site scaled and more and more people wanted to create modules, the model was switched to use GitHub webhooks that have to be set up by the repository owner instead.
lodash
and dayjs
we submitted in the early days of deno.land/x
by community members, so the files of the repo were copied 1:1 over to deno.land/x
and that's why you see the package.json
file in there -- it's literally the same repository content as lodash
.
While the file is available through deno.land/x
via the browser or curl, Deno will never actually reach for it; It'll just look at your entrypoint and walk the dependency graph from there, only looking at JS/TS files. In fact I wouldn't be surprised if the versions of lodash
and dayjs
available on deno.land/x
were completely broken in Deno (at least without import maps.)
推荐阅读
- javascript - 将变量分配给表单字段值
- xamarin.forms - ArcGis 地图不会在导航 Xamarin.Forms 中消失
- c# - 如何使用 xamarin 表单中的会话调用 REST API?
- asp.net - 请求被中止:无法创建 SSL/TLS 安全通道
- java - 无法在 JFrame 上绘画
- ssl - IBM MQ:建立 SSL 连接
- javascript - 如何从另一个对象数组创建具有唯一键/值对的对象数组?
- python - 张量流中lstm中的matmul错误
- matlab - 对数对数图,Matlab 上的曲线拟合
- javascript - 循环的 addEventListener 没有响应