且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在哪里可以看到deno下载的软件包?

更新时间:2023-02-26 19:32:34

导入内容缓存在$DENO_DIR

来自文档:

Deno将远程导入缓存在由 $DENO_DIR环境变量.它默认为系统的缓存 如果未指定$DENO_DIR,则为目录.下次您运行 程序,将不会进行下载.如果程序没有更改, 也不会重新编译.默认目录为:

Deno caches remote imports in a special directory specified by the $DENO_DIR environmental variable. It defaults to the system's cache directory if $DENO_DIR is not specified. The next time you run the program, no downloads will be made. If the program hasn't changed, it won't be recompiled either. The default directory is:

  • 在Linux/Redox上:$XDG_CACHE_HOME/deno$HOME/.cache/deno
  • 在Windows上:%LOCALAPPDATA%/deno(%LOCALAPPDATA% = FOLDERID_LocalAppData)
  • 在macOS上:$HOME/Library/Caches/deno如果出现故障,则回退至 $HOME/.deno
  • On Linux/Redox: $XDG_CACHE_HOME/deno or $HOME/.cache/deno
  • On Windows: %LOCALAPPDATA%/deno (%LOCALAPPDATA% = FOLDERID_LocalAppData)
  • On macOS: $HOME/Library/Caches/deno If something fails, it falls back to $HOME/.deno

依靠外部服务器进行开发很方便,但是却很脆弱 在生产中. 生产软件应始终捆绑其 依赖性.在Deno中,这是通过将$ DENO_DIR签入您的来完成的 源代码管理系统,并将该路径指定为$ DENO_DIR 运行时环境变量.

Relying on external servers is convenient for development but brittle in production. Production software should always bundle its dependencies. In Deno this is done by checking the $DENO_DIR into your source control system, and specifying that path as the $DENO_DIR environmental variable at runtime.


什么是deno命令,用于安装本文档中提到的所有依赖项 dep.ts文件

what is the deno command to install all the dependencies mentioned in dep.ts file

要仅安装导入dep.ts 在您的一个文件中并运行:

To install just import dep.ts in one of your files and run:

deno run index.js