import { copy } from "https://dotland.deno.dev/std@0.221.0/fs/mod.ts";
Asynchronously copy a file or directory. The directory can have contents.
Like cp -r
.
If src
is a directory it will copy everything inside of this directory,
not the entire directory itself. If src
is a file, dest
cannot be a
directory.
Requires the --allow-read
and --allow-write
flag.
Examples
Basic usage
Basic usage
import { copy } from "https://deno.land/std@0.221.0/fs/copy.ts";
await copy("./foo", "./bar");
This will copy the file or directory at ./foo
to ./bar
without
overwriting.