summaryrefslogtreecommitdiff
path: root/ext/node/polyfills/_fs
diff options
context:
space:
mode:
Diffstat (limited to 'ext/node/polyfills/_fs')
-rw-r--r--ext/node/polyfills/_fs/_fs_access.ts12
-rw-r--r--ext/node/polyfills/_fs/_fs_appendFile.ts16
-rw-r--r--ext/node/polyfills/_fs/_fs_chmod.ts12
-rw-r--r--ext/node/polyfills/_fs/_fs_chown.ts12
-rw-r--r--ext/node/polyfills/_fs/_fs_close.ts4
-rw-r--r--ext/node/polyfills/_fs/_fs_common.ts10
-rw-r--r--ext/node/polyfills/_fs/_fs_constants.ts2
-rw-r--r--ext/node/polyfills/_fs/_fs_copy.ts14
-rw-r--r--ext/node/polyfills/_fs/_fs_dir.ts8
-rw-r--r--ext/node/polyfills/_fs/_fs_dirent.ts2
-rw-r--r--ext/node/polyfills/_fs/_fs_exists.ts2
-rw-r--r--ext/node/polyfills/_fs/_fs_fdatasync.ts2
-rw-r--r--ext/node/polyfills/_fs/_fs_fstat.ts2
-rw-r--r--ext/node/polyfills/_fs/_fs_fsync.ts2
-rw-r--r--ext/node/polyfills/_fs/_fs_ftruncate.ts2
-rw-r--r--ext/node/polyfills/_fs/_fs_futimes.ts2
-rw-r--r--ext/node/polyfills/_fs/_fs_link.ts6
-rw-r--r--ext/node/polyfills/_fs/_fs_lstat.ts4
-rw-r--r--ext/node/polyfills/_fs/_fs_mkdir.ts10
-rw-r--r--ext/node/polyfills/_fs/_fs_mkdtemp.ts13
-rw-r--r--ext/node/polyfills/_fs/_fs_open.ts14
-rw-r--r--ext/node/polyfills/_fs/_fs_opendir.ts12
-rw-r--r--ext/node/polyfills/_fs/_fs_read.ts8
-rw-r--r--ext/node/polyfills/_fs/_fs_readFile.ts10
-rw-r--r--ext/node/polyfills/_fs/_fs_readdir.ts17
-rw-r--r--ext/node/polyfills/_fs/_fs_readlink.ts8
-rw-r--r--ext/node/polyfills/_fs/_fs_realpath.ts2
-rw-r--r--ext/node/polyfills/_fs/_fs_rename.ts4
-rw-r--r--ext/node/polyfills/_fs/_fs_rm.ts6
-rw-r--r--ext/node/polyfills/_fs/_fs_rmdir.ts10
-rw-r--r--ext/node/polyfills/_fs/_fs_stat.ts4
-rw-r--r--ext/node/polyfills/_fs/_fs_symlink.ts6
-rw-r--r--ext/node/polyfills/_fs/_fs_truncate.ts6
-rw-r--r--ext/node/polyfills/_fs/_fs_unlink.ts2
-rw-r--r--ext/node/polyfills/_fs/_fs_utimes.ts6
-rw-r--r--ext/node/polyfills/_fs/_fs_watch.ts20
-rw-r--r--ext/node/polyfills/_fs/_fs_write.d.ts5
-rw-r--r--ext/node/polyfills/_fs/_fs_write.mjs10
-rw-r--r--ext/node/polyfills/_fs/_fs_writeFile.ts16
-rw-r--r--ext/node/polyfills/_fs/_fs_writev.d.ts2
-rw-r--r--ext/node/polyfills/_fs/_fs_writev.mjs8
41 files changed, 149 insertions, 164 deletions
diff --git a/ext/node/polyfills/_fs/_fs_access.ts b/ext/node/polyfills/_fs/_fs_access.ts
index ae7c0d5e9..c651837ab 100644
--- a/ext/node/polyfills/_fs/_fs_access.ts
+++ b/ext/node/polyfills/_fs/_fs_access.ts
@@ -3,15 +3,15 @@
import {
type CallbackWithError,
makeCallback,
-} from "internal:deno_node/_fs/_fs_common.ts";
-import { fs } from "internal:deno_node/internal_binding/constants.ts";
-import { codeMap } from "internal:deno_node/internal_binding/uv.ts";
+} from "ext:deno_node/_fs/_fs_common.ts";
+import { fs } from "ext:deno_node/internal_binding/constants.ts";
+import { codeMap } from "ext:deno_node/internal_binding/uv.ts";
import {
getValidatedPath,
getValidMode,
-} from "internal:deno_node/internal/fs/utils.mjs";
-import type { Buffer } from "internal:deno_node/buffer.ts";
-import { promisify } from "internal:deno_node/internal/util.mjs";
+} from "ext:deno_node/internal/fs/utils.mjs";
+import type { Buffer } from "ext:deno_node/buffer.ts";
+import { promisify } from "ext:deno_node/internal/util.mjs";
export function access(
path: string | Buffer | URL,
diff --git a/ext/node/polyfills/_fs/_fs_appendFile.ts b/ext/node/polyfills/_fs/_fs_appendFile.ts
index d460600cc..0045d9a84 100644
--- a/ext/node/polyfills/_fs/_fs_appendFile.ts
+++ b/ext/node/polyfills/_fs/_fs_appendFile.ts
@@ -4,17 +4,11 @@ import {
isFd,
maybeCallback,
WriteFileOptions,
-} from "internal:deno_node/_fs/_fs_common.ts";
-import { Encodings } from "internal:deno_node/_utils.ts";
-import {
- copyObject,
- getOptions,
-} from "internal:deno_node/internal/fs/utils.mjs";
-import {
- writeFile,
- writeFileSync,
-} from "internal:deno_node/_fs/_fs_writeFile.ts";
-import { promisify } from "internal:deno_node/internal/util.mjs";
+} from "ext:deno_node/_fs/_fs_common.ts";
+import { Encodings } from "ext:deno_node/_utils.ts";
+import { copyObject, getOptions } from "ext:deno_node/internal/fs/utils.mjs";
+import { writeFile, writeFileSync } from "ext:deno_node/_fs/_fs_writeFile.ts";
+import { promisify } from "ext:deno_node/internal/util.mjs";
/**
* TODO: Also accept 'data' parameter as a Node polyfill Buffer type once these
diff --git a/ext/node/polyfills/_fs/_fs_chmod.ts b/ext/node/polyfills/_fs/_fs_chmod.ts
index d27bff562..015539e54 100644
--- a/ext/node/polyfills/_fs/_fs_chmod.ts
+++ b/ext/node/polyfills/_fs/_fs_chmod.ts
@@ -1,10 +1,10 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
-import type { CallbackWithError } from "internal:deno_node/_fs/_fs_common.ts";
-import { getValidatedPath } from "internal:deno_node/internal/fs/utils.mjs";
-import * as pathModule from "internal:deno_node/path.ts";
-import { parseFileMode } from "internal:deno_node/internal/validators.mjs";
-import { Buffer } from "internal:deno_node/buffer.ts";
-import { promisify } from "internal:deno_node/internal/util.mjs";
+import type { CallbackWithError } from "ext:deno_node/_fs/_fs_common.ts";
+import { getValidatedPath } from "ext:deno_node/internal/fs/utils.mjs";
+import * as pathModule from "ext:deno_node/path.ts";
+import { parseFileMode } from "ext:deno_node/internal/validators.mjs";
+import { Buffer } from "ext:deno_node/buffer.ts";
+import { promisify } from "ext:deno_node/internal/util.mjs";
export function chmod(
path: string | Buffer | URL,
diff --git a/ext/node/polyfills/_fs/_fs_chown.ts b/ext/node/polyfills/_fs/_fs_chown.ts
index d3323c173..42b0590ae 100644
--- a/ext/node/polyfills/_fs/_fs_chown.ts
+++ b/ext/node/polyfills/_fs/_fs_chown.ts
@@ -2,15 +2,15 @@
import {
type CallbackWithError,
makeCallback,
-} from "internal:deno_node/_fs/_fs_common.ts";
+} from "ext:deno_node/_fs/_fs_common.ts";
import {
getValidatedPath,
kMaxUserId,
-} from "internal:deno_node/internal/fs/utils.mjs";
-import * as pathModule from "internal:deno_node/path.ts";
-import { validateInteger } from "internal:deno_node/internal/validators.mjs";
-import type { Buffer } from "internal:deno_node/buffer.ts";
-import { promisify } from "internal:deno_node/internal/util.mjs";
+} from "ext:deno_node/internal/fs/utils.mjs";
+import * as pathModule from "ext:deno_node/path.ts";
+import { validateInteger } from "ext:deno_node/internal/validators.mjs";
+import type { Buffer } from "ext:deno_node/buffer.ts";
+import { promisify } from "ext:deno_node/internal/util.mjs";
/**
* Asynchronously changes the owner and group
diff --git a/ext/node/polyfills/_fs/_fs_close.ts b/ext/node/polyfills/_fs/_fs_close.ts
index 6c3200614..1f1412b76 100644
--- a/ext/node/polyfills/_fs/_fs_close.ts
+++ b/ext/node/polyfills/_fs/_fs_close.ts
@@ -1,6 +1,6 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
-import type { CallbackWithError } from "internal:deno_node/_fs/_fs_common.ts";
-import { getValidatedFd } from "internal:deno_node/internal/fs/utils.mjs";
+import type { CallbackWithError } from "ext:deno_node/_fs/_fs_common.ts";
+import { getValidatedFd } from "ext:deno_node/internal/fs/utils.mjs";
export function close(fd: number, callback: CallbackWithError) {
fd = getValidatedFd(fd);
diff --git a/ext/node/polyfills/_fs/_fs_common.ts b/ext/node/polyfills/_fs/_fs_common.ts
index 9b4a982bd..c704cd975 100644
--- a/ext/node/polyfills/_fs/_fs_common.ts
+++ b/ext/node/polyfills/_fs/_fs_common.ts
@@ -7,15 +7,15 @@ import {
O_RDWR,
O_TRUNC,
O_WRONLY,
-} from "internal:deno_node/_fs/_fs_constants.ts";
-import { validateFunction } from "internal:deno_node/internal/validators.mjs";
-import type { ErrnoException } from "internal:deno_node/_global.d.ts";
+} from "ext:deno_node/_fs/_fs_constants.ts";
+import { validateFunction } from "ext:deno_node/internal/validators.mjs";
+import type { ErrnoException } from "ext:deno_node/_global.d.ts";
import {
BinaryEncodings,
Encodings,
notImplemented,
TextEncodings,
-} from "internal:deno_node/_utils.ts";
+} from "ext:deno_node/_utils.ts";
export type CallbackWithError = (err: ErrnoException | null) => void;
@@ -212,7 +212,7 @@ export function getOpenOptions(
return openOptions;
}
-export { isUint32 as isFd } from "internal:deno_node/internal/validators.mjs";
+export { isUint32 as isFd } from "ext:deno_node/internal/validators.mjs";
export function maybeCallback(cb: unknown) {
validateFunction(cb, "cb");
diff --git a/ext/node/polyfills/_fs/_fs_constants.ts b/ext/node/polyfills/_fs/_fs_constants.ts
index 8064b576f..bcf28aaad 100644
--- a/ext/node/polyfills/_fs/_fs_constants.ts
+++ b/ext/node/polyfills/_fs/_fs_constants.ts
@@ -1,6 +1,6 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
-import { fs } from "internal:deno_node/internal_binding/constants.ts";
+import { fs } from "ext:deno_node/internal_binding/constants.ts";
export const {
F_OK,
diff --git a/ext/node/polyfills/_fs/_fs_copy.ts b/ext/node/polyfills/_fs/_fs_copy.ts
index 1b83bc402..8561202ec 100644
--- a/ext/node/polyfills/_fs/_fs_copy.ts
+++ b/ext/node/polyfills/_fs/_fs_copy.ts
@@ -1,14 +1,14 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
-import type { CallbackWithError } from "internal:deno_node/_fs/_fs_common.ts";
-import { makeCallback } from "internal:deno_node/_fs/_fs_common.ts";
-import { Buffer } from "internal:deno_node/buffer.ts";
+import type { CallbackWithError } from "ext:deno_node/_fs/_fs_common.ts";
+import { makeCallback } from "ext:deno_node/_fs/_fs_common.ts";
+import { Buffer } from "ext:deno_node/buffer.ts";
import {
getValidatedPath,
getValidMode,
-} from "internal:deno_node/internal/fs/utils.mjs";
-import { fs } from "internal:deno_node/internal_binding/constants.ts";
-import { codeMap } from "internal:deno_node/internal_binding/uv.ts";
-import { promisify } from "internal:deno_node/internal/util.mjs";
+} from "ext:deno_node/internal/fs/utils.mjs";
+import { fs } from "ext:deno_node/internal_binding/constants.ts";
+import { codeMap } from "ext:deno_node/internal_binding/uv.ts";
+import { promisify } from "ext:deno_node/internal/util.mjs";
export function copyFile(
src: string | Buffer | URL,
diff --git a/ext/node/polyfills/_fs/_fs_dir.ts b/ext/node/polyfills/_fs/_fs_dir.ts
index 6e53da2e9..543919bb8 100644
--- a/ext/node/polyfills/_fs/_fs_dir.ts
+++ b/ext/node/polyfills/_fs/_fs_dir.ts
@@ -1,8 +1,8 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
-import Dirent from "internal:deno_node/_fs/_fs_dirent.ts";
-import { assert } from "internal:deno_node/_util/asserts.ts";
-import { ERR_MISSING_ARGS } from "internal:deno_node/internal/errors.ts";
-import { TextDecoder } from "internal:deno_web/08_text_encoding.js";
+import Dirent from "ext:deno_node/_fs/_fs_dirent.ts";
+import { assert } from "ext:deno_node/_util/asserts.ts";
+import { ERR_MISSING_ARGS } from "ext:deno_node/internal/errors.ts";
+import { TextDecoder } from "ext:deno_web/08_text_encoding.js";
export default class Dir {
#dirPath: string | Uint8Array;
diff --git a/ext/node/polyfills/_fs/_fs_dirent.ts b/ext/node/polyfills/_fs/_fs_dirent.ts
index ace83087c..bc1869e07 100644
--- a/ext/node/polyfills/_fs/_fs_dirent.ts
+++ b/ext/node/polyfills/_fs/_fs_dirent.ts
@@ -1,5 +1,5 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
-import { notImplemented } from "internal:deno_node/_utils.ts";
+import { notImplemented } from "ext:deno_node/_utils.ts";
export default class Dirent {
constructor(private entry: Deno.DirEntry) {}
diff --git a/ext/node/polyfills/_fs/_fs_exists.ts b/ext/node/polyfills/_fs/_fs_exists.ts
index 21b0e99c1..37ce599e9 100644
--- a/ext/node/polyfills/_fs/_fs_exists.ts
+++ b/ext/node/polyfills/_fs/_fs_exists.ts
@@ -1,5 +1,5 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
-import { fromFileUrl } from "internal:deno_node/path.ts";
+import { fromFileUrl } from "ext:deno_node/path.ts";
type ExistsCallback = (exists: boolean) => void;
diff --git a/ext/node/polyfills/_fs/_fs_fdatasync.ts b/ext/node/polyfills/_fs/_fs_fdatasync.ts
index 6ee586b71..b45a19cc9 100644
--- a/ext/node/polyfills/_fs/_fs_fdatasync.ts
+++ b/ext/node/polyfills/_fs/_fs_fdatasync.ts
@@ -1,5 +1,5 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
-import { CallbackWithError } from "internal:deno_node/_fs/_fs_common.ts";
+import { CallbackWithError } from "ext:deno_node/_fs/_fs_common.ts";
export function fdatasync(
fd: number,
diff --git a/ext/node/polyfills/_fs/_fs_fstat.ts b/ext/node/polyfills/_fs/_fs_fstat.ts
index c1f7547ff..682aa3eb2 100644
--- a/ext/node/polyfills/_fs/_fs_fstat.ts
+++ b/ext/node/polyfills/_fs/_fs_fstat.ts
@@ -6,7 +6,7 @@ import {
statCallbackBigInt,
statOptions,
Stats,
-} from "internal:deno_node/_fs/_fs_stat.ts";
+} from "ext:deno_node/_fs/_fs_stat.ts";
export function fstat(fd: number, callback: statCallback): void;
export function fstat(
diff --git a/ext/node/polyfills/_fs/_fs_fsync.ts b/ext/node/polyfills/_fs/_fs_fsync.ts
index da81b2753..5867119dd 100644
--- a/ext/node/polyfills/_fs/_fs_fsync.ts
+++ b/ext/node/polyfills/_fs/_fs_fsync.ts
@@ -1,5 +1,5 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
-import { CallbackWithError } from "internal:deno_node/_fs/_fs_common.ts";
+import { CallbackWithError } from "ext:deno_node/_fs/_fs_common.ts";
export function fsync(
fd: number,
diff --git a/ext/node/polyfills/_fs/_fs_ftruncate.ts b/ext/node/polyfills/_fs/_fs_ftruncate.ts
index b2f88c3d6..3d7162b80 100644
--- a/ext/node/polyfills/_fs/_fs_ftruncate.ts
+++ b/ext/node/polyfills/_fs/_fs_ftruncate.ts
@@ -1,5 +1,5 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
-import { CallbackWithError } from "internal:deno_node/_fs/_fs_common.ts";
+import { CallbackWithError } from "ext:deno_node/_fs/_fs_common.ts";
export function ftruncate(
fd: number,
diff --git a/ext/node/polyfills/_fs/_fs_futimes.ts b/ext/node/polyfills/_fs/_fs_futimes.ts
index 2aa3df786..d77832d14 100644
--- a/ext/node/polyfills/_fs/_fs_futimes.ts
+++ b/ext/node/polyfills/_fs/_fs_futimes.ts
@@ -1,6 +1,6 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
-import type { CallbackWithError } from "internal:deno_node/_fs/_fs_common.ts";
+import type { CallbackWithError } from "ext:deno_node/_fs/_fs_common.ts";
function getValidTime(
time: number | string | Date,
diff --git a/ext/node/polyfills/_fs/_fs_link.ts b/ext/node/polyfills/_fs/_fs_link.ts
index 153b18295..3039ade09 100644
--- a/ext/node/polyfills/_fs/_fs_link.ts
+++ b/ext/node/polyfills/_fs/_fs_link.ts
@@ -1,7 +1,7 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
-import type { CallbackWithError } from "internal:deno_node/_fs/_fs_common.ts";
-import { fromFileUrl } from "internal:deno_node/path.ts";
-import { promisify } from "internal:deno_node/internal/util.mjs";
+import type { CallbackWithError } from "ext:deno_node/_fs/_fs_common.ts";
+import { fromFileUrl } from "ext:deno_node/path.ts";
+import { promisify } from "ext:deno_node/internal/util.mjs";
/**
* TODO: Also accept 'path' parameter as a Node polyfill Buffer type once these
diff --git a/ext/node/polyfills/_fs/_fs_lstat.ts b/ext/node/polyfills/_fs/_fs_lstat.ts
index 7acf595d5..2da79d9c4 100644
--- a/ext/node/polyfills/_fs/_fs_lstat.ts
+++ b/ext/node/polyfills/_fs/_fs_lstat.ts
@@ -6,8 +6,8 @@ import {
statCallbackBigInt,
statOptions,
Stats,
-} from "internal:deno_node/_fs/_fs_stat.ts";
-import { promisify } from "internal:deno_node/internal/util.mjs";
+} from "ext:deno_node/_fs/_fs_stat.ts";
+import { promisify } from "ext:deno_node/internal/util.mjs";
export function lstat(path: string | URL, callback: statCallback): void;
export function lstat(
diff --git a/ext/node/polyfills/_fs/_fs_mkdir.ts b/ext/node/polyfills/_fs/_fs_mkdir.ts
index e5aada61f..1e89edfef 100644
--- a/ext/node/polyfills/_fs/_fs_mkdir.ts
+++ b/ext/node/polyfills/_fs/_fs_mkdir.ts
@@ -1,9 +1,9 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
-import type { CallbackWithError } from "internal:deno_node/_fs/_fs_common.ts";
-import { promisify } from "internal:deno_node/internal/util.mjs";
-import { denoErrorToNodeError } from "internal:deno_node/internal/errors.ts";
-import { getValidatedPath } from "internal:deno_node/internal/fs/utils.mjs";
-import { validateBoolean } from "internal:deno_node/internal/validators.mjs";
+import type { CallbackWithError } from "ext:deno_node/_fs/_fs_common.ts";
+import { promisify } from "ext:deno_node/internal/util.mjs";
+import { denoErrorToNodeError } from "ext:deno_node/internal/errors.ts";
+import { getValidatedPath } from "ext:deno_node/internal/fs/utils.mjs";
+import { validateBoolean } from "ext:deno_node/internal/validators.mjs";
/**
* TODO: Also accept 'path' parameter as a Node polyfill Buffer type once these
diff --git a/ext/node/polyfills/_fs/_fs_mkdtemp.ts b/ext/node/polyfills/_fs/_fs_mkdtemp.ts
index bf80d3b74..bc077048d 100644
--- a/ext/node/polyfills/_fs/_fs_mkdtemp.ts
+++ b/ext/node/polyfills/_fs/_fs_mkdtemp.ts
@@ -1,17 +1,14 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
// Copyright Node.js contributors. All rights reserved. MIT License.
-import {
- TextDecoder,
- TextEncoder,
-} from "internal:deno_web/08_text_encoding.js";
-import { existsSync } from "internal:deno_node/_fs/_fs_exists.ts";
-import { mkdir, mkdirSync } from "internal:deno_node/_fs/_fs_mkdir.ts";
+import { TextDecoder, TextEncoder } from "ext:deno_web/08_text_encoding.js";
+import { existsSync } from "ext:deno_node/_fs/_fs_exists.ts";
+import { mkdir, mkdirSync } from "ext:deno_node/_fs/_fs_mkdir.ts";
import {
ERR_INVALID_ARG_TYPE,
ERR_INVALID_OPT_VALUE_ENCODING,
-} from "internal:deno_node/internal/errors.ts";
-import { promisify } from "internal:deno_node/internal/util.mjs";
+} from "ext:deno_node/internal/errors.ts";
+import { promisify } from "ext:deno_node/internal/util.mjs";
export type mkdtempCallback = (
err: Error | null,
diff --git a/ext/node/polyfills/_fs/_fs_open.ts b/ext/node/polyfills/_fs/_fs_open.ts
index 06f3caa4b..135520591 100644
--- a/ext/node/polyfills/_fs/_fs_open.ts
+++ b/ext/node/polyfills/_fs/_fs_open.ts
@@ -6,13 +6,13 @@ import {
O_RDWR,
O_TRUNC,
O_WRONLY,
-} from "internal:deno_node/_fs/_fs_constants.ts";
-import { getOpenOptions } from "internal:deno_node/_fs/_fs_common.ts";
-import { promisify } from "internal:deno_node/internal/util.mjs";
-import { parseFileMode } from "internal:deno_node/internal/validators.mjs";
-import { ERR_INVALID_ARG_TYPE } from "internal:deno_node/internal/errors.ts";
-import { getValidatedPath } from "internal:deno_node/internal/fs/utils.mjs";
-import type { Buffer } from "internal:deno_node/buffer.ts";
+} from "ext:deno_node/_fs/_fs_constants.ts";
+import { getOpenOptions } from "ext:deno_node/_fs/_fs_common.ts";
+import { promisify } from "ext:deno_node/internal/util.mjs";
+import { parseFileMode } from "ext:deno_node/internal/validators.mjs";
+import { ERR_INVALID_ARG_TYPE } from "ext:deno_node/internal/errors.ts";
+import { getValidatedPath } from "ext:deno_node/internal/fs/utils.mjs";
+import type { Buffer } from "ext:deno_node/buffer.ts";
function existsSync(filePath: string | URL): boolean {
try {
diff --git a/ext/node/polyfills/_fs/_fs_opendir.ts b/ext/node/polyfills/_fs/_fs_opendir.ts
index a14f12f15..494bdb4f0 100644
--- a/ext/node/polyfills/_fs/_fs_opendir.ts
+++ b/ext/node/polyfills/_fs/_fs_opendir.ts
@@ -1,17 +1,17 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
-import Dir from "internal:deno_node/_fs/_fs_dir.ts";
-import { Buffer } from "internal:deno_node/buffer.ts";
+import Dir from "ext:deno_node/_fs/_fs_dir.ts";
+import { Buffer } from "ext:deno_node/buffer.ts";
import {
getOptions,
getValidatedPath,
-} from "internal:deno_node/internal/fs/utils.mjs";
-import { denoErrorToNodeError } from "internal:deno_node/internal/errors.ts";
+} from "ext:deno_node/internal/fs/utils.mjs";
+import { denoErrorToNodeError } from "ext:deno_node/internal/errors.ts";
import {
validateFunction,
validateInteger,
-} from "internal:deno_node/internal/validators.mjs";
-import { promisify } from "internal:deno_node/internal/util.mjs";
+} from "ext:deno_node/internal/validators.mjs";
+import { promisify } from "ext:deno_node/internal/util.mjs";
/** These options aren't funcitonally used right now, as `Dir` doesn't yet support them.
* However, these values are still validated.
diff --git a/ext/node/polyfills/_fs/_fs_read.ts b/ext/node/polyfills/_fs/_fs_read.ts
index 8aeebfecb..b34384dd4 100644
--- a/ext/node/polyfills/_fs/_fs_read.ts
+++ b/ext/node/polyfills/_fs/_fs_read.ts
@@ -1,14 +1,14 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
-import { Buffer } from "internal:deno_node/buffer.ts";
-import { ERR_INVALID_ARG_TYPE } from "internal:deno_node/internal/errors.ts";
+import { Buffer } from "ext:deno_node/buffer.ts";
+import { ERR_INVALID_ARG_TYPE } from "ext:deno_node/internal/errors.ts";
import {
validateOffsetLengthRead,
validatePosition,
-} from "internal:deno_node/internal/fs/utils.mjs";
+} from "ext:deno_node/internal/fs/utils.mjs";
import {
validateBuffer,
validateInteger,
-} from "internal:deno_node/internal/validators.mjs";
+} from "ext:deno_node/internal/validators.mjs";
type readOptions = {
buffer: Buffer | Uint8Array;
diff --git a/ext/node/polyfills/_fs/_fs_readFile.ts b/ext/node/polyfills/_fs/_fs_readFile.ts
index 24f58f6d1..0ff8a311a 100644
--- a/ext/node/polyfills/_fs/_fs_readFile.ts
+++ b/ext/node/polyfills/_fs/_fs_readFile.ts
@@ -4,15 +4,15 @@ import {
FileOptionsArgument,
getEncoding,
TextOptionsArgument,
-} from "internal:deno_node/_fs/_fs_common.ts";
-import { Buffer } from "internal:deno_node/buffer.ts";
-import { fromFileUrl } from "internal:deno_node/path.ts";
+} from "ext:deno_node/_fs/_fs_common.ts";
+import { Buffer } from "ext:deno_node/buffer.ts";
+import { fromFileUrl } from "ext:deno_node/path.ts";
import {
BinaryEncodings,
Encodings,
TextEncodings,
-} from "internal:deno_node/_utils.ts";
-import { promisify } from "internal:deno_node/internal/util.mjs";
+} from "ext:deno_node/_utils.ts";
+import { promisify } from "ext:deno_node/internal/util.mjs";
function maybeDecode(data: Uint8Array, encoding: TextEncodings): string;
function maybeDecode(
diff --git a/ext/node/polyfills/_fs/_fs_readdir.ts b/ext/node/polyfills/_fs/_fs_readdir.ts
index af828c2c0..6cd8e7393 100644
--- a/ext/node/polyfills/_fs/_fs_readdir.ts
+++ b/ext/node/polyfills/_fs/_fs_readdir.ts
@@ -1,15 +1,12 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
-import {
- TextDecoder,
- TextEncoder,
-} from "internal:deno_web/08_text_encoding.js";
-import { asyncIterableToCallback } from "internal:deno_node/_fs/_fs_watch.ts";
-import Dirent from "internal:deno_node/_fs/_fs_dirent.ts";
-import { denoErrorToNodeError } from "internal:deno_node/internal/errors.ts";
-import { getValidatedPath } from "internal:deno_node/internal/fs/utils.mjs";
-import { Buffer } from "internal:deno_node/buffer.ts";
-import { promisify } from "internal:deno_node/internal/util.mjs";
+import { TextDecoder, TextEncoder } from "ext:deno_web/08_text_encoding.js";
+import { asyncIterableToCallback } from "ext:deno_node/_fs/_fs_watch.ts";
+import Dirent from "ext:deno_node/_fs/_fs_dirent.ts";
+import { denoErrorToNodeError } from "ext:deno_node/internal/errors.ts";
+import { getValidatedPath } from "ext:deno_node/internal/fs/utils.mjs";
+import { Buffer } from "ext:deno_node/buffer.ts";
+import { promisify } from "ext:deno_node/internal/util.mjs";
function toDirent(val: Deno.DirEntry): Dirent {
return new Dirent(val);
diff --git a/ext/node/polyfills/_fs/_fs_readlink.ts b/ext/node/polyfills/_fs/_fs_readlink.ts
index 69cd9d2d9..982376152 100644
--- a/ext/node/polyfills/_fs/_fs_readlink.ts
+++ b/ext/node/polyfills/_fs/_fs_readlink.ts
@@ -1,13 +1,13 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
-import { TextEncoder } from "internal:deno_web/08_text_encoding.js";
+import { TextEncoder } from "ext:deno_web/08_text_encoding.js";
import {
intoCallbackAPIWithIntercept,
MaybeEmpty,
notImplemented,
-} from "internal:deno_node/_utils.ts";
-import { fromFileUrl } from "internal:deno_node/path.ts";
-import { promisify } from "internal:deno_node/internal/util.mjs";
+} from "ext:deno_node/_utils.ts";
+import { fromFileUrl } from "ext:deno_node/path.ts";
+import { promisify } from "ext:deno_node/internal/util.mjs";
type ReadlinkCallback = (
err: MaybeEmpty<Error>,
diff --git a/ext/node/polyfills/_fs/_fs_realpath.ts b/ext/node/polyfills/_fs/_fs_realpath.ts
index 7254f8a28..106e1f5b6 100644
--- a/ext/node/polyfills/_fs/_fs_realpath.ts
+++ b/ext/node/polyfills/_fs/_fs_realpath.ts
@@ -1,5 +1,5 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
-import { promisify } from "internal:deno_node/internal/util.mjs";
+import { promisify } from "ext:deno_node/internal/util.mjs";
type Options = { encoding: string };
type Callback = (err: Error | null, path?: string) => void;
diff --git a/ext/node/polyfills/_fs/_fs_rename.ts b/ext/node/polyfills/_fs/_fs_rename.ts
index 10ec90078..5d87619c7 100644
--- a/ext/node/polyfills/_fs/_fs_rename.ts
+++ b/ext/node/polyfills/_fs/_fs_rename.ts
@@ -1,6 +1,6 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
-import { fromFileUrl } from "internal:deno_node/path.ts";
-import { promisify } from "internal:deno_node/internal/util.mjs";
+import { fromFileUrl } from "ext:deno_node/path.ts";
+import { promisify } from "ext:deno_node/internal/util.mjs";
export function rename(
oldPath: string | URL,
diff --git a/ext/node/polyfills/_fs/_fs_rm.ts b/ext/node/polyfills/_fs/_fs_rm.ts
index dbbe12179..07daa81ae 100644
--- a/ext/node/polyfills/_fs/_fs_rm.ts
+++ b/ext/node/polyfills/_fs/_fs_rm.ts
@@ -2,9 +2,9 @@
import {
validateRmOptions,
validateRmOptionsSync,
-} from "internal:deno_node/internal/fs/utils.mjs";
-import { denoErrorToNodeError } from "internal:deno_node/internal/errors.ts";
-import { promisify } from "internal:deno_node/internal/util.mjs";
+} from "ext:deno_node/internal/fs/utils.mjs";
+import { denoErrorToNodeError } from "ext:deno_node/internal/errors.ts";
+import { promisify } from "ext:deno_node/internal/util.mjs";
type rmOptions = {
force?: boolean;
diff --git a/ext/node/polyfills/_fs/_fs_rmdir.ts b/ext/node/polyfills/_fs/_fs_rmdir.ts
index 186f92447..98bf43718 100644
--- a/ext/node/polyfills/_fs/_fs_rmdir.ts
+++ b/ext/node/polyfills/_fs/_fs_rmdir.ts
@@ -5,14 +5,14 @@ import {
validateRmdirOptions,
validateRmOptions,
validateRmOptionsSync,
-} from "internal:deno_node/internal/fs/utils.mjs";
-import { toNamespacedPath } from "internal:deno_node/path.ts";
+} from "ext:deno_node/internal/fs/utils.mjs";
+import { toNamespacedPath } from "ext:deno_node/path.ts";
import {
denoErrorToNodeError,
ERR_FS_RMDIR_ENOTDIR,
-} from "internal:deno_node/internal/errors.ts";
-import { Buffer } from "internal:deno_node/buffer.ts";
-import { promisify } from "internal:deno_node/internal/util.mjs";
+} from "ext:deno_node/internal/errors.ts";
+import { Buffer } from "ext:deno_node/buffer.ts";
+import { promisify } from "ext:deno_node/internal/util.mjs";
type rmdirOptions = {
maxRetries?: number;
diff --git a/ext/node/polyfills/_fs/_fs_stat.ts b/ext/node/polyfills/_fs/_fs_stat.ts
index 3a496cb40..a87217676 100644
--- a/ext/node/polyfills/_fs/_fs_stat.ts
+++ b/ext/node/polyfills/_fs/_fs_stat.ts
@@ -1,6 +1,6 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
-import { denoErrorToNodeError } from "internal:deno_node/internal/errors.ts";
-import { promisify } from "internal:deno_node/internal/util.mjs";
+import { denoErrorToNodeError } from "ext:deno_node/internal/errors.ts";
+import { promisify } from "ext:deno_node/internal/util.mjs";
export type statOptions = {
bigint: boolean;
diff --git a/ext/node/polyfills/_fs/_fs_symlink.ts b/ext/node/polyfills/_fs/_fs_symlink.ts
index abaa780ae..23e4deaa5 100644
--- a/ext/node/polyfills/_fs/_fs_symlink.ts
+++ b/ext/node/polyfills/_fs/_fs_symlink.ts
@@ -1,7 +1,7 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
-import { CallbackWithError } from "internal:deno_node/_fs/_fs_common.ts";
-import { fromFileUrl } from "internal:deno_node/path.ts";
-import { promisify } from "internal:deno_node/internal/util.mjs";
+import { CallbackWithError } from "ext:deno_node/_fs/_fs_common.ts";
+import { fromFileUrl } from "ext:deno_node/path.ts";
+import { promisify } from "ext:deno_node/internal/util.mjs";
type SymlinkType = "file" | "dir";
diff --git a/ext/node/polyfills/_fs/_fs_truncate.ts b/ext/node/polyfills/_fs/_fs_truncate.ts
index 9cdbbdbf3..b6d39352b 100644
--- a/ext/node/polyfills/_fs/_fs_truncate.ts
+++ b/ext/node/polyfills/_fs/_fs_truncate.ts
@@ -1,7 +1,7 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
-import { CallbackWithError } from "internal:deno_node/_fs/_fs_common.ts";
-import { fromFileUrl } from "internal:deno_node/path.ts";
-import { promisify } from "internal:deno_node/internal/util.mjs";
+import { CallbackWithError } from "ext:deno_node/_fs/_fs_common.ts";
+import { fromFileUrl } from "ext:deno_node/path.ts";
+import { promisify } from "ext:deno_node/internal/util.mjs";
export function truncate(
path: string | URL,
diff --git a/ext/node/polyfills/_fs/_fs_unlink.ts b/ext/node/polyfills/_fs/_fs_unlink.ts
index b54edc717..36941a251 100644
--- a/ext/node/polyfills/_fs/_fs_unlink.ts
+++ b/ext/node/polyfills/_fs/_fs_unlink.ts
@@ -1,5 +1,5 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
-import { promisify } from "internal:deno_node/internal/util.mjs";
+import { promisify } from "ext:deno_node/internal/util.mjs";
export function unlink(path: string | URL, callback: (err?: Error) => void) {
if (!callback) throw new Error("No callback function supplied");
diff --git a/ext/node/polyfills/_fs/_fs_utimes.ts b/ext/node/polyfills/_fs/_fs_utimes.ts
index 1e104a463..93b108f00 100644
--- a/ext/node/polyfills/_fs/_fs_utimes.ts
+++ b/ext/node/polyfills/_fs/_fs_utimes.ts
@@ -1,8 +1,8 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
-import type { CallbackWithError } from "internal:deno_node/_fs/_fs_common.ts";
-import { fromFileUrl } from "internal:deno_node/path.ts";
-import { promisify } from "internal:deno_node/internal/util.mjs";
+import type { CallbackWithError } from "ext:deno_node/_fs/_fs_common.ts";
+import { fromFileUrl } from "ext:deno_node/path.ts";
+import { promisify } from "ext:deno_node/internal/util.mjs";
function getValidTime(
time: number | string | Date,
diff --git a/ext/node/polyfills/_fs/_fs_watch.ts b/ext/node/polyfills/_fs/_fs_watch.ts
index 7924eeeed..2674c01a8 100644
--- a/ext/node/polyfills/_fs/_fs_watch.ts
+++ b/ext/node/polyfills/_fs/_fs_watch.ts
@@ -1,14 +1,14 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
-import { basename } from "internal:deno_node/path.ts";
-import { EventEmitter } from "internal:deno_node/events.ts";
-import { notImplemented } from "internal:deno_node/_utils.ts";
-import { promisify } from "internal:deno_node/util.ts";
-import { getValidatedPath } from "internal:deno_node/internal/fs/utils.mjs";
-import { validateFunction } from "internal:deno_node/internal/validators.mjs";
-import { stat, Stats } from "internal:deno_node/_fs/_fs_stat.ts";
-import { Stats as StatsClass } from "internal:deno_node/internal/fs/utils.mjs";
-import { Buffer } from "internal:deno_node/buffer.ts";
-import { delay } from "internal:deno_node/_util/async.ts";
+import { basename } from "ext:deno_node/path.ts";
+import { EventEmitter } from "ext:deno_node/events.ts";
+import { notImplemented } from "ext:deno_node/_utils.ts";
+import { promisify } from "ext:deno_node/util.ts";
+import { getValidatedPath } from "ext:deno_node/internal/fs/utils.mjs";
+import { validateFunction } from "ext:deno_node/internal/validators.mjs";
+import { stat, Stats } from "ext:deno_node/_fs/_fs_stat.ts";
+import { Stats as StatsClass } from "ext:deno_node/internal/fs/utils.mjs";
+import { Buffer } from "ext:deno_node/buffer.ts";
+import { delay } from "ext:deno_node/_util/async.ts";
const statPromisified = promisify(stat);
const statAsync = async (filename: string): Promise<Stats | null> => {
diff --git a/ext/node/polyfills/_fs/_fs_write.d.ts b/ext/node/polyfills/_fs/_fs_write.d.ts
index cfa97c5fc..4111f03a7 100644
--- a/ext/node/polyfills/_fs/_fs_write.d.ts
+++ b/ext/node/polyfills/_fs/_fs_write.d.ts
@@ -1,10 +1,7 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
// Forked from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/d9df51e34526f48bef4e2546a006157b391ad96c/types/node/fs.d.ts
-import {
- BufferEncoding,
- ErrnoException,
-} from "internal:deno_node/_global.d.ts";
+import { BufferEncoding, ErrnoException } from "ext:deno_node/_global.d.ts";
/**
* Write `buffer` to the file specified by `fd`. If `buffer` is a normal object, it
diff --git a/ext/node/polyfills/_fs/_fs_write.mjs b/ext/node/polyfills/_fs/_fs_write.mjs
index 110e7dfb8..bd0ffd105 100644
--- a/ext/node/polyfills/_fs/_fs_write.mjs
+++ b/ext/node/polyfills/_fs/_fs_write.mjs
@@ -1,15 +1,15 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
// Copyright Joyent, Inc. and Node.js contributors. All rights reserved. MIT license.
-import { Buffer } from "internal:deno_node/buffer.ts";
-import { validateEncoding, validateInteger } from "internal:deno_node/internal/validators.mjs";
+import { Buffer } from "ext:deno_node/buffer.ts";
+import { validateEncoding, validateInteger } from "ext:deno_node/internal/validators.mjs";
import {
getValidatedFd,
showStringCoercionDeprecation,
validateOffsetLengthWrite,
validateStringAfterArrayBufferView,
-} from "internal:deno_node/internal/fs/utils.mjs";
-import { isArrayBufferView } from "internal:deno_node/internal/util/types.ts";
-import { maybeCallback } from "internal:deno_node/_fs/_fs_common.ts";
+} from "ext:deno_node/internal/fs/utils.mjs";
+import { isArrayBufferView } from "ext:deno_node/internal/util/types.ts";
+import { maybeCallback } from "ext:deno_node/_fs/_fs_common.ts";
export function writeSync(fd, buffer, offset, length, position) {
fd = getValidatedFd(fd);
diff --git a/ext/node/polyfills/_fs/_fs_writeFile.ts b/ext/node/polyfills/_fs/_fs_writeFile.ts
index d3f0d35df..a72d49147 100644
--- a/ext/node/polyfills/_fs/_fs_writeFile.ts
+++ b/ext/node/polyfills/_fs/_fs_writeFile.ts
@@ -1,7 +1,7 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
-import { Encodings } from "internal:deno_node/_utils.ts";
-import { fromFileUrl } from "internal:deno_node/path.ts";
-import { Buffer } from "internal:deno_node/buffer.ts";
+import { Encodings } from "ext:deno_node/_utils.ts";
+import { fromFileUrl } from "ext:deno_node/path.ts";
+import { Buffer } from "ext:deno_node/buffer.ts";
import {
CallbackWithError,
checkEncoding,
@@ -9,17 +9,17 @@ import {
getOpenOptions,
isFileOptions,
WriteFileOptions,
-} from "internal:deno_node/_fs/_fs_common.ts";
-import { isWindows } from "internal:deno_node/_util/os.ts";
+} from "ext:deno_node/_fs/_fs_common.ts";
+import { isWindows } from "ext:deno_node/_util/os.ts";
import {
AbortError,
denoErrorToNodeError,
-} from "internal:deno_node/internal/errors.ts";
+} from "ext:deno_node/internal/errors.ts";
import {
showStringCoercionDeprecation,
validateStringAfterArrayBufferView,
-} from "internal:deno_node/internal/fs/utils.mjs";
-import { promisify } from "internal:deno_node/internal/util.mjs";
+} from "ext:deno_node/internal/fs/utils.mjs";
+import { promisify } from "ext:deno_node/internal/util.mjs";
interface Writer {
write(p: Uint8Array): Promise<number>;
diff --git a/ext/node/polyfills/_fs/_fs_writev.d.ts b/ext/node/polyfills/_fs/_fs_writev.d.ts
index 909b955d1..83155bcd7 100644
--- a/ext/node/polyfills/_fs/_fs_writev.d.ts
+++ b/ext/node/polyfills/_fs/_fs_writev.d.ts
@@ -1,7 +1,7 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
// Forked from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/d9df51e34526f48bef4e2546a006157b391ad96c/types/node/fs.d.ts
-import { ErrnoException } from "internal:deno_node/_global.d.ts";
+import { ErrnoException } from "ext:deno_node/_global.d.ts";
/**
* Write an array of `ArrayBufferView`s to the file specified by `fd` using`writev()`.
diff --git a/ext/node/polyfills/_fs/_fs_writev.mjs b/ext/node/polyfills/_fs/_fs_writev.mjs
index 49d0b9a21..7440f4fd7 100644
--- a/ext/node/polyfills/_fs/_fs_writev.mjs
+++ b/ext/node/polyfills/_fs/_fs_writev.mjs
@@ -1,9 +1,9 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
// Copyright Joyent, Inc. and Node.js contributors. All rights reserved. MIT license.
-import { Buffer } from "internal:deno_node/buffer.ts";
-import { validateBufferArray } from "internal:deno_node/internal/fs/utils.mjs";
-import { getValidatedFd } from "internal:deno_node/internal/fs/utils.mjs";
-import { maybeCallback } from "internal:deno_node/_fs/_fs_common.ts";
+import { Buffer } from "ext:deno_node/buffer.ts";
+import { validateBufferArray } from "ext:deno_node/internal/fs/utils.mjs";
+import { getValidatedFd } from "ext:deno_node/internal/fs/utils.mjs";
+import { maybeCallback } from "ext:deno_node/_fs/_fs_common.ts";
export function writev(fd, buffers, position, callback) {
const innerWritev = async (fd, buffers, position) => {