gpt4 book ai didi

node.js - 如何在 deno 中删除运行时导入缓存?

转载 作者:行者123 更新时间:2023-12-03 12:11:07 26 4
gpt4 key购买 nike

在 node.js 我们可以使用

delete require.cache[require.resolve(somePath)];

在运行时删除需要缓存。

有没有类似的方法来删除 deno 中的运行时导入缓存?

最佳答案

-r--reload选项将重新编译导入的模块。

-r, --reload=<CACHE_BLACKLIST>     Reload source code cache (recompile TypeScript)

https://deno.land/manual#other-key-behaviors

Other key behaviors

  • Remote code is fetched and cached on first execution, and never updated until the code is run with the --reload flag. (So, this will still work on an airplane.)
  • Modules/files loaded from remote URLs are intended to be immutable and cacheable.


您可以传递参数以重新加载特定模块:
--reload=https://deno.land/std

https://deno.land/manual/linking_to_external_code/reloading_modules

关于node.js - 如何在 deno 中删除运行时导入缓存?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61903993/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com