Skip to main content

上传文件和目录

Deno Sandboxes provide a sandboxed environment for evaluating JavaScript code. This is useful for evaluating code that is not trusted or for testing code that is not safe to run in the main runtime.

使用 sandbox.upload(localPath, sandboxPath) 将文件从您的机器复制到沙箱中。

import { Sandbox } from "@deno/sandbox";

await using sandbox = await Sandbox.create();

// 将单个文件上传到沙箱中的指定路径
await sandbox.upload("./README.md", "./readme-copy.md");

// 将本地目录树上传到沙箱当前目录
await sandbox.upload("./my-project", ".");

For more information about Sandboxes, see the Sandboxes documentation.

你找到了你需要的东西吗?

编辑此页面
隐私政策