shim more buffer methods, and fs methods

getting importer plugin to work,
This commit is contained in:
Nystik
2026-03-23 22:58:01 +01:00
parent 6dd62a15fa
commit a98afa46f5
10 changed files with 533 additions and 6 deletions

View File

@@ -4,6 +4,7 @@ import { transport } from "./transport.js";
import { createFsPromises } from "./promises.js";
import { createFsSync } from "./sync.js";
import { createFsWatch } from "./watch.js";
import { createFdOps } from "./fd.js";
import { constants } from "./constants.js";
const metadataCache = new MetadataCache();
@@ -12,6 +13,7 @@ const contentCache = new ContentCache();
const fsPromises = createFsPromises(metadataCache, contentCache, transport);
const fsSync = createFsSync(metadataCache, contentCache, transport);
const fsWatch = createFsWatch(transport);
const fdOps = createFdOps(metadataCache, contentCache, transport);
export const fsShim = {
promises: fsPromises,
@@ -24,6 +26,15 @@ export const fsShim = {
statSync: fsSync.statSync,
readdirSync: fsSync.readdirSync,
open: fdOps.open,
openSync: fdOps.openSync,
read: fdOps.read,
readSync: fdOps.readSync,
close: fdOps.close,
closeSync: fdOps.closeSync,
fstat: fdOps.fstat,
fstatSync: fdOps.fstatSync,
watch: fsWatch.watch,
constants,