2024-01-01 14:58:21 -05:00
|
|
|
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
2023-02-14 11:38:45 -05:00
|
|
|
import {
|
|
|
|
access,
|
|
|
|
accessPromise,
|
|
|
|
accessSync,
|
2023-03-08 06:44:54 -05:00
|
|
|
} from "ext:deno_node/_fs/_fs_access.ts";
|
2023-02-14 11:38:45 -05:00
|
|
|
import {
|
|
|
|
appendFile,
|
|
|
|
appendFilePromise,
|
|
|
|
appendFileSync,
|
2023-03-08 06:44:54 -05:00
|
|
|
} from "ext:deno_node/_fs/_fs_appendFile.ts";
|
|
|
|
import { chmod, chmodPromise, chmodSync } from "ext:deno_node/_fs/_fs_chmod.ts";
|
|
|
|
import { chown, chownPromise, chownSync } from "ext:deno_node/_fs/_fs_chown.ts";
|
|
|
|
import { close, closeSync } from "ext:deno_node/_fs/_fs_close.ts";
|
|
|
|
import * as constants from "ext:deno_node/_fs/_fs_constants.ts";
|
2023-02-14 11:38:45 -05:00
|
|
|
import {
|
|
|
|
copyFile,
|
|
|
|
copyFilePromise,
|
|
|
|
copyFileSync,
|
2023-03-08 06:44:54 -05:00
|
|
|
} from "ext:deno_node/_fs/_fs_copy.ts";
|
2024-01-05 07:58:33 -05:00
|
|
|
import { cp, cpPromise, cpSync } from "ext:deno_node/_fs/_fs_cp.js";
|
2023-03-08 06:44:54 -05:00
|
|
|
import Dir from "ext:deno_node/_fs/_fs_dir.ts";
|
|
|
|
import Dirent from "ext:deno_node/_fs/_fs_dirent.ts";
|
|
|
|
import { exists, existsSync } from "ext:deno_node/_fs/_fs_exists.ts";
|
|
|
|
import { fdatasync, fdatasyncSync } from "ext:deno_node/_fs/_fs_fdatasync.ts";
|
|
|
|
import { fstat, fstatSync } from "ext:deno_node/_fs/_fs_fstat.ts";
|
|
|
|
import { fsync, fsyncSync } from "ext:deno_node/_fs/_fs_fsync.ts";
|
|
|
|
import { ftruncate, ftruncateSync } from "ext:deno_node/_fs/_fs_ftruncate.ts";
|
|
|
|
import { futimes, futimesSync } from "ext:deno_node/_fs/_fs_futimes.ts";
|
|
|
|
import { link, linkPromise, linkSync } from "ext:deno_node/_fs/_fs_link.ts";
|
|
|
|
import { lstat, lstatPromise, lstatSync } from "ext:deno_node/_fs/_fs_lstat.ts";
|
|
|
|
import { mkdir, mkdirPromise, mkdirSync } from "ext:deno_node/_fs/_fs_mkdir.ts";
|
2023-02-14 11:38:45 -05:00
|
|
|
import {
|
|
|
|
mkdtemp,
|
|
|
|
mkdtempPromise,
|
|
|
|
mkdtempSync,
|
2023-03-08 06:44:54 -05:00
|
|
|
} from "ext:deno_node/_fs/_fs_mkdtemp.ts";
|
|
|
|
import { open, openPromise, openSync } from "ext:deno_node/_fs/_fs_open.ts";
|
2023-02-14 11:38:45 -05:00
|
|
|
import {
|
|
|
|
opendir,
|
|
|
|
opendirPromise,
|
|
|
|
opendirSync,
|
2023-03-08 06:44:54 -05:00
|
|
|
} from "ext:deno_node/_fs/_fs_opendir.ts";
|
|
|
|
import { read, readSync } from "ext:deno_node/_fs/_fs_read.ts";
|
2023-02-14 11:38:45 -05:00
|
|
|
import {
|
|
|
|
readdir,
|
|
|
|
readdirPromise,
|
|
|
|
readdirSync,
|
2023-03-08 06:44:54 -05:00
|
|
|
} from "ext:deno_node/_fs/_fs_readdir.ts";
|
2023-02-14 11:38:45 -05:00
|
|
|
import {
|
|
|
|
readFile,
|
|
|
|
readFilePromise,
|
|
|
|
readFileSync,
|
2023-03-08 06:44:54 -05:00
|
|
|
} from "ext:deno_node/_fs/_fs_readFile.ts";
|
2023-02-14 11:38:45 -05:00
|
|
|
import {
|
|
|
|
readlink,
|
|
|
|
readlinkPromise,
|
|
|
|
readlinkSync,
|
2023-03-08 06:44:54 -05:00
|
|
|
} from "ext:deno_node/_fs/_fs_readlink.ts";
|
2023-02-14 11:38:45 -05:00
|
|
|
import {
|
|
|
|
realpath,
|
|
|
|
realpathPromise,
|
|
|
|
realpathSync,
|
2023-03-08 06:44:54 -05:00
|
|
|
} from "ext:deno_node/_fs/_fs_realpath.ts";
|
2023-02-14 11:38:45 -05:00
|
|
|
import {
|
|
|
|
rename,
|
|
|
|
renamePromise,
|
|
|
|
renameSync,
|
2023-03-08 06:44:54 -05:00
|
|
|
} from "ext:deno_node/_fs/_fs_rename.ts";
|
|
|
|
import { rmdir, rmdirPromise, rmdirSync } from "ext:deno_node/_fs/_fs_rmdir.ts";
|
|
|
|
import { rm, rmPromise, rmSync } from "ext:deno_node/_fs/_fs_rm.ts";
|
2024-03-06 07:59:10 -05:00
|
|
|
import {
|
|
|
|
stat,
|
|
|
|
statPromise,
|
|
|
|
Stats,
|
|
|
|
statSync,
|
|
|
|
} from "ext:deno_node/_fs/_fs_stat.ts";
|
2024-03-13 06:57:59 -04:00
|
|
|
import {
|
|
|
|
statfs,
|
|
|
|
statfsPromise,
|
|
|
|
statfsSync,
|
|
|
|
} from "ext:deno_node/_fs/_fs_statfs.js";
|
2023-02-14 11:38:45 -05:00
|
|
|
import {
|
|
|
|
symlink,
|
|
|
|
symlinkPromise,
|
|
|
|
symlinkSync,
|
2023-03-08 06:44:54 -05:00
|
|
|
} from "ext:deno_node/_fs/_fs_symlink.ts";
|
2023-02-14 11:38:45 -05:00
|
|
|
import {
|
|
|
|
truncate,
|
|
|
|
truncatePromise,
|
|
|
|
truncateSync,
|
2023-03-08 06:44:54 -05:00
|
|
|
} from "ext:deno_node/_fs/_fs_truncate.ts";
|
2023-02-14 11:38:45 -05:00
|
|
|
import {
|
|
|
|
unlink,
|
|
|
|
unlinkPromise,
|
|
|
|
unlinkSync,
|
2023-03-08 06:44:54 -05:00
|
|
|
} from "ext:deno_node/_fs/_fs_unlink.ts";
|
2023-02-14 11:38:45 -05:00
|
|
|
import {
|
|
|
|
utimes,
|
|
|
|
utimesPromise,
|
|
|
|
utimesSync,
|
2023-03-08 06:44:54 -05:00
|
|
|
} from "ext:deno_node/_fs/_fs_utimes.ts";
|
2023-02-14 11:38:45 -05:00
|
|
|
import {
|
|
|
|
unwatchFile,
|
|
|
|
watch,
|
|
|
|
watchFile,
|
|
|
|
watchPromise,
|
2023-03-08 06:44:54 -05:00
|
|
|
} from "ext:deno_node/_fs/_fs_watch.ts";
|
2023-02-14 11:38:45 -05:00
|
|
|
// @deno-types="./_fs/_fs_write.d.ts"
|
2023-03-08 06:44:54 -05:00
|
|
|
import { write, writeSync } from "ext:deno_node/_fs/_fs_write.mjs";
|
2023-02-14 11:38:45 -05:00
|
|
|
// @deno-types="./_fs/_fs_writev.d.ts"
|
2023-03-08 06:44:54 -05:00
|
|
|
import { writev, writevSync } from "ext:deno_node/_fs/_fs_writev.mjs";
|
2024-04-01 23:42:49 -04:00
|
|
|
import { readv, readvSync } from "ext:deno_node/_fs/_fs_readv.ts";
|
2023-02-14 11:38:45 -05:00
|
|
|
import {
|
|
|
|
writeFile,
|
|
|
|
writeFilePromise,
|
|
|
|
writeFileSync,
|
2023-03-08 06:44:54 -05:00
|
|
|
} from "ext:deno_node/_fs/_fs_writeFile.ts";
|
2023-02-14 11:38:45 -05:00
|
|
|
// @deno-types="./internal/fs/streams.d.ts"
|
|
|
|
import {
|
|
|
|
createReadStream,
|
|
|
|
createWriteStream,
|
|
|
|
ReadStream,
|
|
|
|
WriteStream,
|
2023-03-08 06:44:54 -05:00
|
|
|
} from "ext:deno_node/internal/fs/streams.mjs";
|
2023-02-14 11:38:45 -05:00
|
|
|
|
|
|
|
const {
|
|
|
|
F_OK,
|
|
|
|
R_OK,
|
|
|
|
W_OK,
|
|
|
|
X_OK,
|
|
|
|
O_RDONLY,
|
|
|
|
O_WRONLY,
|
|
|
|
O_RDWR,
|
|
|
|
O_NOCTTY,
|
|
|
|
O_TRUNC,
|
|
|
|
O_APPEND,
|
|
|
|
O_DIRECTORY,
|
|
|
|
O_NOFOLLOW,
|
|
|
|
O_SYNC,
|
|
|
|
O_DSYNC,
|
|
|
|
O_SYMLINK,
|
|
|
|
O_NONBLOCK,
|
|
|
|
O_CREAT,
|
|
|
|
O_EXCL,
|
|
|
|
} = constants;
|
|
|
|
|
|
|
|
const promises = {
|
|
|
|
access: accessPromise,
|
2024-01-21 15:48:48 -05:00
|
|
|
constants,
|
2023-02-14 11:38:45 -05:00
|
|
|
copyFile: copyFilePromise,
|
2024-01-05 07:58:33 -05:00
|
|
|
cp: cpPromise,
|
2023-02-14 11:38:45 -05:00
|
|
|
open: openPromise,
|
|
|
|
opendir: opendirPromise,
|
|
|
|
rename: renamePromise,
|
|
|
|
truncate: truncatePromise,
|
|
|
|
rm: rmPromise,
|
|
|
|
rmdir: rmdirPromise,
|
|
|
|
mkdir: mkdirPromise,
|
|
|
|
readdir: readdirPromise,
|
|
|
|
readlink: readlinkPromise,
|
|
|
|
symlink: symlinkPromise,
|
|
|
|
lstat: lstatPromise,
|
|
|
|
stat: statPromise,
|
2024-03-13 06:57:59 -04:00
|
|
|
statfs: statfsPromise,
|
2023-02-14 11:38:45 -05:00
|
|
|
link: linkPromise,
|
|
|
|
unlink: unlinkPromise,
|
|
|
|
chmod: chmodPromise,
|
|
|
|
// lchmod: promisify(lchmod),
|
|
|
|
// lchown: promisify(lchown),
|
|
|
|
chown: chownPromise,
|
|
|
|
utimes: utimesPromise,
|
|
|
|
// lutimes = promisify(lutimes),
|
|
|
|
realpath: realpathPromise,
|
|
|
|
mkdtemp: mkdtempPromise,
|
|
|
|
writeFile: writeFilePromise,
|
|
|
|
appendFile: appendFilePromise,
|
|
|
|
readFile: readFilePromise,
|
|
|
|
watch: watchPromise,
|
|
|
|
};
|
|
|
|
|
|
|
|
export default {
|
|
|
|
access,
|
|
|
|
accessSync,
|
|
|
|
appendFile,
|
|
|
|
appendFileSync,
|
|
|
|
chmod,
|
|
|
|
chmodSync,
|
|
|
|
chown,
|
|
|
|
chownSync,
|
|
|
|
close,
|
|
|
|
closeSync,
|
|
|
|
constants,
|
|
|
|
copyFile,
|
|
|
|
copyFileSync,
|
2024-01-05 07:58:33 -05:00
|
|
|
cp,
|
|
|
|
cpSync,
|
2023-02-14 11:38:45 -05:00
|
|
|
createReadStream,
|
|
|
|
createWriteStream,
|
|
|
|
Dir,
|
|
|
|
Dirent,
|
|
|
|
exists,
|
|
|
|
existsSync,
|
|
|
|
F_OK,
|
|
|
|
fdatasync,
|
|
|
|
fdatasyncSync,
|
|
|
|
fstat,
|
|
|
|
fstatSync,
|
|
|
|
fsync,
|
|
|
|
fsyncSync,
|
|
|
|
ftruncate,
|
|
|
|
ftruncateSync,
|
|
|
|
futimes,
|
|
|
|
futimesSync,
|
|
|
|
link,
|
|
|
|
linkSync,
|
|
|
|
lstat,
|
|
|
|
lstatSync,
|
|
|
|
mkdir,
|
|
|
|
mkdirSync,
|
|
|
|
mkdtemp,
|
|
|
|
mkdtempSync,
|
|
|
|
O_APPEND,
|
|
|
|
O_CREAT,
|
|
|
|
O_DIRECTORY,
|
|
|
|
O_DSYNC,
|
|
|
|
O_EXCL,
|
|
|
|
O_NOCTTY,
|
|
|
|
O_NOFOLLOW,
|
|
|
|
O_NONBLOCK,
|
|
|
|
O_RDONLY,
|
|
|
|
O_RDWR,
|
|
|
|
O_SYMLINK,
|
|
|
|
O_SYNC,
|
|
|
|
O_TRUNC,
|
|
|
|
O_WRONLY,
|
|
|
|
open,
|
|
|
|
openSync,
|
|
|
|
opendir,
|
|
|
|
opendirSync,
|
|
|
|
read,
|
|
|
|
readSync,
|
|
|
|
promises,
|
|
|
|
R_OK,
|
|
|
|
readdir,
|
|
|
|
readdirSync,
|
|
|
|
readFile,
|
|
|
|
readFileSync,
|
|
|
|
readlink,
|
|
|
|
readlinkSync,
|
|
|
|
ReadStream,
|
|
|
|
realpath,
|
|
|
|
realpathSync,
|
2024-04-01 23:42:49 -04:00
|
|
|
readv,
|
|
|
|
readvSync,
|
2023-02-14 11:38:45 -05:00
|
|
|
rename,
|
|
|
|
renameSync,
|
|
|
|
rmdir,
|
|
|
|
rmdirSync,
|
|
|
|
rm,
|
|
|
|
rmSync,
|
|
|
|
stat,
|
|
|
|
Stats,
|
|
|
|
statSync,
|
2024-03-13 06:57:59 -04:00
|
|
|
statfs,
|
|
|
|
statfsSync,
|
2023-02-14 11:38:45 -05:00
|
|
|
symlink,
|
|
|
|
symlinkSync,
|
|
|
|
truncate,
|
|
|
|
truncateSync,
|
|
|
|
unlink,
|
|
|
|
unlinkSync,
|
|
|
|
unwatchFile,
|
|
|
|
utimes,
|
|
|
|
utimesSync,
|
|
|
|
W_OK,
|
|
|
|
watch,
|
|
|
|
watchFile,
|
|
|
|
write,
|
|
|
|
writeFile,
|
|
|
|
writev,
|
|
|
|
writevSync,
|
|
|
|
writeFileSync,
|
|
|
|
WriteStream,
|
|
|
|
writeSync,
|
|
|
|
X_OK,
|
|
|
|
};
|
|
|
|
|
|
|
|
export {
|
|
|
|
access,
|
|
|
|
accessSync,
|
|
|
|
appendFile,
|
|
|
|
appendFileSync,
|
|
|
|
chmod,
|
|
|
|
chmodSync,
|
|
|
|
chown,
|
|
|
|
chownSync,
|
|
|
|
close,
|
|
|
|
closeSync,
|
|
|
|
constants,
|
|
|
|
copyFile,
|
|
|
|
copyFileSync,
|
2024-01-05 07:58:33 -05:00
|
|
|
cp,
|
|
|
|
cpSync,
|
2023-02-14 11:38:45 -05:00
|
|
|
createReadStream,
|
|
|
|
createWriteStream,
|
|
|
|
Dir,
|
|
|
|
Dirent,
|
|
|
|
exists,
|
|
|
|
existsSync,
|
|
|
|
F_OK,
|
|
|
|
fdatasync,
|
|
|
|
fdatasyncSync,
|
|
|
|
fstat,
|
|
|
|
fstatSync,
|
|
|
|
fsync,
|
|
|
|
fsyncSync,
|
|
|
|
ftruncate,
|
|
|
|
ftruncateSync,
|
|
|
|
futimes,
|
|
|
|
futimesSync,
|
|
|
|
link,
|
|
|
|
linkSync,
|
|
|
|
lstat,
|
|
|
|
lstatSync,
|
|
|
|
mkdir,
|
|
|
|
mkdirSync,
|
|
|
|
mkdtemp,
|
|
|
|
mkdtempSync,
|
|
|
|
O_APPEND,
|
|
|
|
O_CREAT,
|
|
|
|
O_DIRECTORY,
|
|
|
|
O_DSYNC,
|
|
|
|
O_EXCL,
|
|
|
|
O_NOCTTY,
|
|
|
|
O_NOFOLLOW,
|
|
|
|
O_NONBLOCK,
|
|
|
|
O_RDONLY,
|
|
|
|
O_RDWR,
|
|
|
|
O_SYMLINK,
|
|
|
|
O_SYNC,
|
|
|
|
O_TRUNC,
|
|
|
|
O_WRONLY,
|
|
|
|
open,
|
|
|
|
opendir,
|
|
|
|
opendirSync,
|
|
|
|
openSync,
|
|
|
|
promises,
|
|
|
|
R_OK,
|
|
|
|
read,
|
|
|
|
readdir,
|
|
|
|
readdirSync,
|
|
|
|
readFile,
|
|
|
|
readFileSync,
|
|
|
|
readlink,
|
|
|
|
readlinkSync,
|
|
|
|
ReadStream,
|
|
|
|
readSync,
|
2024-04-01 23:42:49 -04:00
|
|
|
readv,
|
|
|
|
readvSync,
|
2023-02-14 11:38:45 -05:00
|
|
|
realpath,
|
|
|
|
realpathSync,
|
|
|
|
rename,
|
|
|
|
renameSync,
|
|
|
|
rm,
|
|
|
|
rmdir,
|
|
|
|
rmdirSync,
|
|
|
|
rmSync,
|
|
|
|
stat,
|
2024-03-13 06:57:59 -04:00
|
|
|
statfs,
|
|
|
|
statfsSync,
|
2023-02-14 11:38:45 -05:00
|
|
|
Stats,
|
|
|
|
statSync,
|
|
|
|
symlink,
|
|
|
|
symlinkSync,
|
|
|
|
truncate,
|
|
|
|
truncateSync,
|
|
|
|
unlink,
|
|
|
|
unlinkSync,
|
|
|
|
unwatchFile,
|
|
|
|
utimes,
|
|
|
|
utimesSync,
|
|
|
|
W_OK,
|
|
|
|
watch,
|
|
|
|
watchFile,
|
|
|
|
write,
|
|
|
|
writeFile,
|
|
|
|
writeFileSync,
|
|
|
|
WriteStream,
|
|
|
|
writeSync,
|
|
|
|
writev,
|
|
|
|
writevSync,
|
|
|
|
X_OK,
|
|
|
|
};
|