/
githubmirror
/
deno
Обзор
Документация
Войти
/
githubmirror
/
deno
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
tests/specs/node/node_fs_cp/main.mjs
30 строк
651 B
Nathan Whitaker
perf(ext/node): fast path fs cp (#35856)
09 июл 2026, 21:47
Не верифицирован
09 июл 2026, 21:47
fd8bf48
Код
Авторство
О чём код?
import assert from "node:assert/strict"; import fs from "node:fs/promises"; import path from "node:path"; const src = path.join(import.meta.dirname, "source"); const target = path.join(import.meta.dirname, "dist"); try { await fs.rm(target, { recursive: true }); } catch { // ignore } assert.strictEqual( await fs.cp(src, target, { recursive: true, force: true }), undefined, ); assert.strictEqual( await fs.cp(src, target, { recursive: true, force: true }), undefined, ); const entries = await Array.fromAsync(await fs.readdir(target)); console.log(entries); try { await fs.rm(target, { recursive: true }); } catch { // ignore }