@ricsam/isolate-fs 0.1.10 → 0.1.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -189,7 +189,12 @@ function createNodeFileSystemHandler(rootPath, options) {
189
189
  await fh.close();
190
190
  }
191
191
  } else {
192
- await fsPromises.writeFile(realPath, data);
192
+ const fh = await fsPromises.open(realPath, "w");
193
+ try {
194
+ await fh.writeFile(data);
195
+ } finally {
196
+ await fh.close();
197
+ }
193
198
  }
194
199
  } catch (err) {
195
200
  throw mapError(err, "writeFile");
@@ -225,4 +230,4 @@ function createNodeFileSystemHandler(rootPath, options) {
225
230
  };
226
231
  }
227
232
 
228
- //# debugId=77DE8B80714C24D564756E2164756E21
233
+ //# debugId=2D2EAFEF15D8B7DF64756E2164756E21
@@ -2,9 +2,9 @@
2
2
  "version": 3,
3
3
  "sources": ["../../src/node-adapter.ts"],
4
4
  "sourcesContent": [
5
- "import * as nodeFs from \"node:fs\";\nimport * as nodePath from \"node:path\";\nimport { lookup as mimeLookup } from \"mime-types\";\nimport type { FileSystemHandler } from \"./index.cjs\";\n\nexport interface NodeFileSystemHandlerOptions {\n /** Custom fs module (e.g., memfs for testing). Defaults to Node.js fs */\n fs?: typeof nodeFs;\n}\n\n/**\n * Create a FileSystemHandler backed by the Node.js filesystem\n *\n * @param rootPath - Absolute path to the root directory for the sandbox\n * @param options - Optional configuration\n * @returns FileSystemHandler implementation\n *\n * @example\n * import { createNodeFileSystemHandler } from \"@ricsam/isolate-fs\";\n *\n * const handler = createNodeFileSystemHandler(\"/tmp/sandbox\");\n *\n * // Use with createRuntime\n * const runtime = await createRuntime({\n * fs: { handler }\n * });\n */\nexport function createNodeFileSystemHandler(\n rootPath: string,\n options?: NodeFileSystemHandlerOptions\n): FileSystemHandler {\n const fs = options?.fs ?? nodeFs;\n const fsPromises = fs.promises;\n\n // Resolve the root path to ensure it's absolute\n const resolvedRoot = nodePath.resolve(rootPath);\n\n /**\n * Map a virtual path to a real filesystem path\n * Virtual paths always start with \"/\" and are relative to rootPath\n */\n function toRealPath(virtualPath: string): string {\n // Normalize the virtual path\n const normalized = nodePath.normalize(virtualPath);\n // Join with root, handling the leading slash\n const relativePath = normalized.startsWith(\"/\")\n ? normalized.slice(1)\n : normalized;\n return nodePath.join(resolvedRoot, relativePath);\n }\n\n /**\n * Map Node.js errors to DOMException-style error messages\n */\n function mapError(err: unknown, operation: string): Error {\n if (!(err instanceof Error)) {\n return new Error(`[Error]${operation} failed`);\n }\n\n const nodeError = err as NodeJS.ErrnoException;\n\n switch (nodeError.code) {\n case \"ENOENT\":\n return new Error(`[NotFoundError]${operation}: path not found`);\n case \"EISDIR\":\n return new Error(\n `[TypeMismatchError]${operation}: expected file but found directory`\n );\n case \"ENOTDIR\":\n return new Error(\n `[TypeMismatchError]${operation}: expected directory but found file`\n );\n case \"ENOTEMPTY\":\n return new Error(\n `[InvalidModificationError]${operation}: directory not empty`\n );\n case \"EEXIST\":\n return new Error(`[InvalidModificationError]${operation}: already exists`);\n case \"EACCES\":\n case \"EPERM\":\n return new Error(`[NotAllowedError]${operation}: permission denied`);\n default:\n return new Error(`[Error]${operation}: ${nodeError.message}`);\n }\n }\n\n /**\n * Get MIME type for a file based on extension\n */\n function getMimeType(filePath: string): string {\n const result = mimeLookup(filePath);\n return result || \"application/octet-stream\";\n }\n\n return {\n async getFileHandle(\n path: string,\n options?: { create?: boolean }\n ): Promise<void> {\n const realPath = toRealPath(path);\n\n try {\n const stats = await fsPromises.stat(realPath);\n if (stats.isDirectory()) {\n throw new Error(\n \"[TypeMismatchError]getFileHandle: expected file but found directory\"\n );\n }\n // File exists and is a file - success\n } catch (err) {\n const nodeError = err as NodeJS.ErrnoException;\n if (nodeError.code === \"ENOENT\") {\n if (options?.create) {\n // Create empty file\n await fsPromises.writeFile(realPath, \"\");\n return;\n }\n throw new Error(\"[NotFoundError]getFileHandle: file not found\");\n }\n throw mapError(err, \"getFileHandle\");\n }\n },\n\n async getDirectoryHandle(\n path: string,\n options?: { create?: boolean }\n ): Promise<void> {\n const realPath = toRealPath(path);\n\n try {\n const stats = await fsPromises.stat(realPath);\n if (!stats.isDirectory()) {\n throw new Error(\n \"[TypeMismatchError]getDirectoryHandle: expected directory but found file\"\n );\n }\n // Directory exists - success\n } catch (err) {\n const nodeError = err as NodeJS.ErrnoException;\n if (nodeError.code === \"ENOENT\") {\n if (options?.create) {\n // Create directory\n await fsPromises.mkdir(realPath, { recursive: true });\n return;\n }\n throw new Error(\n \"[NotFoundError]getDirectoryHandle: directory not found\"\n );\n }\n throw mapError(err, \"getDirectoryHandle\");\n }\n },\n\n async removeEntry(\n path: string,\n options?: { recursive?: boolean }\n ): Promise<void> {\n const realPath = toRealPath(path);\n\n try {\n const stats = await fsPromises.stat(realPath);\n\n if (stats.isDirectory()) {\n if (options?.recursive) {\n // Use rm with recursive for non-empty directories\n await fsPromises.rm(realPath, { recursive: true });\n } else {\n // Try rmdir for empty directories (will fail if not empty)\n await fsPromises.rmdir(realPath);\n }\n } else {\n // Use unlink for files\n await fsPromises.unlink(realPath);\n }\n } catch (err) {\n throw mapError(err, \"removeEntry\");\n }\n },\n\n async readDirectory(\n path: string\n ): Promise<Array<{ name: string; kind: \"file\" | \"directory\" }>> {\n const realPath = toRealPath(path);\n\n try {\n const entries = await fsPromises.readdir(realPath, {\n withFileTypes: true,\n });\n\n return entries.map((entry) => ({\n name: entry.name,\n kind: entry.isDirectory() ? (\"directory\" as const) : (\"file\" as const),\n }));\n } catch (err) {\n throw mapError(err, \"readDirectory\");\n }\n },\n\n async readFile(\n path: string\n ): Promise<{\n data: Uint8Array;\n size: number;\n lastModified: number;\n type: string;\n }> {\n const realPath = toRealPath(path);\n\n try {\n const [data, stats] = await Promise.all([\n fsPromises.readFile(realPath),\n fsPromises.stat(realPath),\n ]);\n\n if (stats.isDirectory()) {\n throw new Error(\n \"[TypeMismatchError]readFile: expected file but found directory\"\n );\n }\n\n return {\n data: new Uint8Array(data),\n size: stats.size,\n lastModified: stats.mtimeMs,\n type: getMimeType(realPath),\n };\n } catch (err) {\n if (err instanceof Error && err.message.startsWith(\"[\")) {\n throw err;\n }\n throw mapError(err, \"readFile\");\n }\n },\n\n async writeFile(\n path: string,\n data: Uint8Array,\n position?: number\n ): Promise<void> {\n const realPath = toRealPath(path);\n\n try {\n // Check file exists first (matches WHATWG semantics where file must exist via getFileHandle)\n await fsPromises.access(realPath);\n\n if (position !== undefined) {\n // Position-based write - need to use r+ to preserve existing content\n const fh = await fsPromises.open(realPath, \"r+\");\n try {\n await fh.write(data, 0, data.length, position);\n } finally {\n await fh.close();\n }\n } else {\n // Replace entire content\n await fsPromises.writeFile(realPath, data);\n }\n } catch (err) {\n throw mapError(err, \"writeFile\");\n }\n },\n\n async truncateFile(path: string, size: number): Promise<void> {\n const realPath = toRealPath(path);\n\n try {\n await fsPromises.truncate(realPath, size);\n } catch (err) {\n throw mapError(err, \"truncateFile\");\n }\n },\n\n async getFileMetadata(\n path: string\n ): Promise<{ size: number; lastModified: number; type: string }> {\n const realPath = toRealPath(path);\n\n try {\n const stats = await fsPromises.stat(realPath);\n\n if (stats.isDirectory()) {\n throw new Error(\n \"[TypeMismatchError]getFileMetadata: expected file but found directory\"\n );\n }\n\n return {\n size: stats.size,\n lastModified: stats.mtimeMs,\n type: getMimeType(realPath),\n };\n } catch (err) {\n if (err instanceof Error && err.message.startsWith(\"[\")) {\n throw err;\n }\n throw mapError(err, \"getFileMetadata\");\n }\n },\n };\n}\n"
5
+ "import * as nodeFs from \"node:fs\";\nimport * as nodePath from \"node:path\";\nimport { lookup as mimeLookup } from \"mime-types\";\nimport type { FileSystemHandler } from \"./index.cjs\";\n\nexport interface NodeFileSystemHandlerOptions {\n /** Custom fs module (e.g., memfs for testing). Defaults to Node.js fs */\n fs?: typeof nodeFs;\n}\n\n/**\n * Create a FileSystemHandler backed by the Node.js filesystem\n *\n * @param rootPath - Absolute path to the root directory for the sandbox\n * @param options - Optional configuration\n * @returns FileSystemHandler implementation\n *\n * @example\n * import { createNodeFileSystemHandler } from \"@ricsam/isolate-fs\";\n *\n * const handler = createNodeFileSystemHandler(\"/tmp/sandbox\");\n *\n * // Use with createRuntime\n * const runtime = await createRuntime({\n * fs: { handler }\n * });\n */\nexport function createNodeFileSystemHandler(\n rootPath: string,\n options?: NodeFileSystemHandlerOptions\n): FileSystemHandler {\n const fs = options?.fs ?? nodeFs;\n const fsPromises = fs.promises;\n\n // Resolve the root path to ensure it's absolute\n const resolvedRoot = nodePath.resolve(rootPath);\n\n /**\n * Map a virtual path to a real filesystem path\n * Virtual paths always start with \"/\" and are relative to rootPath\n */\n function toRealPath(virtualPath: string): string {\n // Normalize the virtual path\n const normalized = nodePath.normalize(virtualPath);\n // Join with root, handling the leading slash\n const relativePath = normalized.startsWith(\"/\")\n ? normalized.slice(1)\n : normalized;\n return nodePath.join(resolvedRoot, relativePath);\n }\n\n /**\n * Map Node.js errors to DOMException-style error messages\n */\n function mapError(err: unknown, operation: string): Error {\n if (!(err instanceof Error)) {\n return new Error(`[Error]${operation} failed`);\n }\n\n const nodeError = err as NodeJS.ErrnoException;\n\n switch (nodeError.code) {\n case \"ENOENT\":\n return new Error(`[NotFoundError]${operation}: path not found`);\n case \"EISDIR\":\n return new Error(\n `[TypeMismatchError]${operation}: expected file but found directory`\n );\n case \"ENOTDIR\":\n return new Error(\n `[TypeMismatchError]${operation}: expected directory but found file`\n );\n case \"ENOTEMPTY\":\n return new Error(\n `[InvalidModificationError]${operation}: directory not empty`\n );\n case \"EEXIST\":\n return new Error(`[InvalidModificationError]${operation}: already exists`);\n case \"EACCES\":\n case \"EPERM\":\n return new Error(`[NotAllowedError]${operation}: permission denied`);\n default:\n return new Error(`[Error]${operation}: ${nodeError.message}`);\n }\n }\n\n /**\n * Get MIME type for a file based on extension\n */\n function getMimeType(filePath: string): string {\n const result = mimeLookup(filePath);\n return result || \"application/octet-stream\";\n }\n\n return {\n async getFileHandle(\n path: string,\n options?: { create?: boolean }\n ): Promise<void> {\n const realPath = toRealPath(path);\n\n try {\n const stats = await fsPromises.stat(realPath);\n if (stats.isDirectory()) {\n throw new Error(\n \"[TypeMismatchError]getFileHandle: expected file but found directory\"\n );\n }\n // File exists and is a file - success\n } catch (err) {\n const nodeError = err as NodeJS.ErrnoException;\n if (nodeError.code === \"ENOENT\") {\n if (options?.create) {\n // Create empty file\n await fsPromises.writeFile(realPath, \"\");\n return;\n }\n throw new Error(\"[NotFoundError]getFileHandle: file not found\");\n }\n throw mapError(err, \"getFileHandle\");\n }\n },\n\n async getDirectoryHandle(\n path: string,\n options?: { create?: boolean }\n ): Promise<void> {\n const realPath = toRealPath(path);\n\n try {\n const stats = await fsPromises.stat(realPath);\n if (!stats.isDirectory()) {\n throw new Error(\n \"[TypeMismatchError]getDirectoryHandle: expected directory but found file\"\n );\n }\n // Directory exists - success\n } catch (err) {\n const nodeError = err as NodeJS.ErrnoException;\n if (nodeError.code === \"ENOENT\") {\n if (options?.create) {\n // Create directory\n await fsPromises.mkdir(realPath, { recursive: true });\n return;\n }\n throw new Error(\n \"[NotFoundError]getDirectoryHandle: directory not found\"\n );\n }\n throw mapError(err, \"getDirectoryHandle\");\n }\n },\n\n async removeEntry(\n path: string,\n options?: { recursive?: boolean }\n ): Promise<void> {\n const realPath = toRealPath(path);\n\n try {\n const stats = await fsPromises.stat(realPath);\n\n if (stats.isDirectory()) {\n if (options?.recursive) {\n // Use rm with recursive for non-empty directories\n await fsPromises.rm(realPath, { recursive: true });\n } else {\n // Try rmdir for empty directories (will fail if not empty)\n await fsPromises.rmdir(realPath);\n }\n } else {\n // Use unlink for files\n await fsPromises.unlink(realPath);\n }\n } catch (err) {\n throw mapError(err, \"removeEntry\");\n }\n },\n\n async readDirectory(\n path: string\n ): Promise<Array<{ name: string; kind: \"file\" | \"directory\" }>> {\n const realPath = toRealPath(path);\n\n try {\n const entries = await fsPromises.readdir(realPath, {\n withFileTypes: true,\n });\n\n return entries.map((entry) => ({\n name: entry.name,\n kind: entry.isDirectory() ? (\"directory\" as const) : (\"file\" as const),\n }));\n } catch (err) {\n throw mapError(err, \"readDirectory\");\n }\n },\n\n async readFile(\n path: string\n ): Promise<{\n data: Uint8Array;\n size: number;\n lastModified: number;\n type: string;\n }> {\n const realPath = toRealPath(path);\n\n try {\n const [data, stats] = await Promise.all([\n fsPromises.readFile(realPath),\n fsPromises.stat(realPath),\n ]);\n\n if (stats.isDirectory()) {\n throw new Error(\n \"[TypeMismatchError]readFile: expected file but found directory\"\n );\n }\n\n return {\n data: new Uint8Array(data),\n size: stats.size,\n lastModified: stats.mtimeMs,\n type: getMimeType(realPath),\n };\n } catch (err) {\n if (err instanceof Error && err.message.startsWith(\"[\")) {\n throw err;\n }\n throw mapError(err, \"readFile\");\n }\n },\n\n async writeFile(\n path: string,\n data: Uint8Array,\n position?: number\n ): Promise<void> {\n const realPath = toRealPath(path);\n\n try {\n // Check file exists first (matches WHATWG semantics where file must exist via getFileHandle)\n await fsPromises.access(realPath);\n\n if (position !== undefined) {\n // Position-based write - need to use r+ to preserve existing content\n const fh = await fsPromises.open(realPath, \"r+\");\n try {\n await fh.write(data, 0, data.length, position);\n } finally {\n await fh.close();\n }\n } else {\n // Replace entire content\n const fh = await fsPromises.open(realPath, 'w');\n try {\n await fh.writeFile(data);\n } finally {\n await fh.close();\n }\n }\n } catch (err) {\n throw mapError(err, \"writeFile\");\n }\n },\n\n async truncateFile(path: string, size: number): Promise<void> {\n const realPath = toRealPath(path);\n\n try {\n await fsPromises.truncate(realPath, size);\n } catch (err) {\n throw mapError(err, \"truncateFile\");\n }\n },\n\n async getFileMetadata(\n path: string\n ): Promise<{ size: number; lastModified: number; type: string }> {\n const realPath = toRealPath(path);\n\n try {\n const stats = await fsPromises.stat(realPath);\n\n if (stats.isDirectory()) {\n throw new Error(\n \"[TypeMismatchError]getFileMetadata: expected file but found directory\"\n );\n }\n\n return {\n size: stats.size,\n lastModified: stats.mtimeMs,\n type: getMimeType(realPath),\n };\n } catch (err) {\n if (err instanceof Error && err.message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AG;AAAA,UACvD,MAAM;AAAA,QACR;AAAA,QACA,MAAM,SAAS,KAAK,iBAAiB;AAAA;AAAA;AAAA,EAG3C;AAAA;",
8
+ "debugId": "2D2EAFEF15D8B7DF64756E2164756E21",
9
9
  "names": []
10
10
  }
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@ricsam/isolate-fs",
3
- "version": "0.1.10",
3
+ "version": "0.1.12",
4
4
  "type": "commonjs"
5
5
  }
@@ -143,7 +143,12 @@ function createNodeFileSystemHandler(rootPath, options) {
143
143
  await fh.close();
144
144
  }
145
145
  } else {
146
- await fsPromises.writeFile(realPath, data);
146
+ const fh = await fsPromises.open(realPath, "w");
147
+ try {
148
+ await fh.writeFile(data);
149
+ } finally {
150
+ await fh.close();
151
+ }
147
152
  }
148
153
  } catch (err) {
149
154
  throw mapError(err, "writeFile");
@@ -182,4 +187,4 @@ export {
182
187
  createNodeFileSystemHandler
183
188
  };
184
189
 
185
- //# debugId=B6183C8F432695A964756E2164756E21
190
+ //# debugId=5F70AB435AA05E2464756E2164756E21
@@ -2,9 +2,9 @@
2
2
  "version": 3,
3
3
  "sources": ["../../src/node-adapter.ts"],
4
4
  "sourcesContent": [
5
- "import * as nodeFs from \"node:fs\";\nimport * as nodePath from \"node:path\";\nimport { lookup as mimeLookup } from \"mime-types\";\nimport type { FileSystemHandler } from \"./index.mjs\";\n\nexport interface NodeFileSystemHandlerOptions {\n /** Custom fs module (e.g., memfs for testing). Defaults to Node.js fs */\n fs?: typeof nodeFs;\n}\n\n/**\n * Create a FileSystemHandler backed by the Node.js filesystem\n *\n * @param rootPath - Absolute path to the root directory for the sandbox\n * @param options - Optional configuration\n * @returns FileSystemHandler implementation\n *\n * @example\n * import { createNodeFileSystemHandler } from \"@ricsam/isolate-fs\";\n *\n * const handler = createNodeFileSystemHandler(\"/tmp/sandbox\");\n *\n * // Use with createRuntime\n * const runtime = await createRuntime({\n * fs: { handler }\n * });\n */\nexport function createNodeFileSystemHandler(\n rootPath: string,\n options?: NodeFileSystemHandlerOptions\n): FileSystemHandler {\n const fs = options?.fs ?? nodeFs;\n const fsPromises = fs.promises;\n\n // Resolve the root path to ensure it's absolute\n const resolvedRoot = nodePath.resolve(rootPath);\n\n /**\n * Map a virtual path to a real filesystem path\n * Virtual paths always start with \"/\" and are relative to rootPath\n */\n function toRealPath(virtualPath: string): string {\n // Normalize the virtual path\n const normalized = nodePath.normalize(virtualPath);\n // Join with root, handling the leading slash\n const relativePath = normalized.startsWith(\"/\")\n ? normalized.slice(1)\n : normalized;\n return nodePath.join(resolvedRoot, relativePath);\n }\n\n /**\n * Map Node.js errors to DOMException-style error messages\n */\n function mapError(err: unknown, operation: string): Error {\n if (!(err instanceof Error)) {\n return new Error(`[Error]${operation} failed`);\n }\n\n const nodeError = err as NodeJS.ErrnoException;\n\n switch (nodeError.code) {\n case \"ENOENT\":\n return new Error(`[NotFoundError]${operation}: path not found`);\n case \"EISDIR\":\n return new Error(\n `[TypeMismatchError]${operation}: expected file but found directory`\n );\n case \"ENOTDIR\":\n return new Error(\n `[TypeMismatchError]${operation}: expected directory but found file`\n );\n case \"ENOTEMPTY\":\n return new Error(\n `[InvalidModificationError]${operation}: directory not empty`\n );\n case \"EEXIST\":\n return new Error(`[InvalidModificationError]${operation}: already exists`);\n case \"EACCES\":\n case \"EPERM\":\n return new Error(`[NotAllowedError]${operation}: permission denied`);\n default:\n return new Error(`[Error]${operation}: ${nodeError.message}`);\n }\n }\n\n /**\n * Get MIME type for a file based on extension\n */\n function getMimeType(filePath: string): string {\n const result = mimeLookup(filePath);\n return result || \"application/octet-stream\";\n }\n\n return {\n async getFileHandle(\n path: string,\n options?: { create?: boolean }\n ): Promise<void> {\n const realPath = toRealPath(path);\n\n try {\n const stats = await fsPromises.stat(realPath);\n if (stats.isDirectory()) {\n throw new Error(\n \"[TypeMismatchError]getFileHandle: expected file but found directory\"\n );\n }\n // File exists and is a file - success\n } catch (err) {\n const nodeError = err as NodeJS.ErrnoException;\n if (nodeError.code === \"ENOENT\") {\n if (options?.create) {\n // Create empty file\n await fsPromises.writeFile(realPath, \"\");\n return;\n }\n throw new Error(\"[NotFoundError]getFileHandle: file not found\");\n }\n throw mapError(err, \"getFileHandle\");\n }\n },\n\n async getDirectoryHandle(\n path: string,\n options?: { create?: boolean }\n ): Promise<void> {\n const realPath = toRealPath(path);\n\n try {\n const stats = await fsPromises.stat(realPath);\n if (!stats.isDirectory()) {\n throw new Error(\n \"[TypeMismatchError]getDirectoryHandle: expected directory but found file\"\n );\n }\n // Directory exists - success\n } catch (err) {\n const nodeError = err as NodeJS.ErrnoException;\n if (nodeError.code === \"ENOENT\") {\n if (options?.create) {\n // Create directory\n await fsPromises.mkdir(realPath, { recursive: true });\n return;\n }\n throw new Error(\n \"[NotFoundError]getDirectoryHandle: directory not found\"\n );\n }\n throw mapError(err, \"getDirectoryHandle\");\n }\n },\n\n async removeEntry(\n path: string,\n options?: { recursive?: boolean }\n ): Promise<void> {\n const realPath = toRealPath(path);\n\n try {\n const stats = await fsPromises.stat(realPath);\n\n if (stats.isDirectory()) {\n if (options?.recursive) {\n // Use rm with recursive for non-empty directories\n await fsPromises.rm(realPath, { recursive: true });\n } else {\n // Try rmdir for empty directories (will fail if not empty)\n await fsPromises.rmdir(realPath);\n }\n } else {\n // Use unlink for files\n await fsPromises.unlink(realPath);\n }\n } catch (err) {\n throw mapError(err, \"removeEntry\");\n }\n },\n\n async readDirectory(\n path: string\n ): Promise<Array<{ name: string; kind: \"file\" | \"directory\" }>> {\n const realPath = toRealPath(path);\n\n try {\n const entries = await fsPromises.readdir(realPath, {\n withFileTypes: true,\n });\n\n return entries.map((entry) => ({\n name: entry.name,\n kind: entry.isDirectory() ? (\"directory\" as const) : (\"file\" as const),\n }));\n } catch (err) {\n throw mapError(err, \"readDirectory\");\n }\n },\n\n async readFile(\n path: string\n ): Promise<{\n data: Uint8Array;\n size: number;\n lastModified: number;\n type: string;\n }> {\n const realPath = toRealPath(path);\n\n try {\n const [data, stats] = await Promise.all([\n fsPromises.readFile(realPath),\n fsPromises.stat(realPath),\n ]);\n\n if (stats.isDirectory()) {\n throw new Error(\n \"[TypeMismatchError]readFile: expected file but found directory\"\n );\n }\n\n return {\n data: new Uint8Array(data),\n size: stats.size,\n lastModified: stats.mtimeMs,\n type: getMimeType(realPath),\n };\n } catch (err) {\n if (err instanceof Error && err.message.startsWith(\"[\")) {\n throw err;\n }\n throw mapError(err, \"readFile\");\n }\n },\n\n async writeFile(\n path: string,\n data: Uint8Array,\n position?: number\n ): Promise<void> {\n const realPath = toRealPath(path);\n\n try {\n // Check file exists first (matches WHATWG semantics where file must exist via getFileHandle)\n await fsPromises.access(realPath);\n\n if (position !== undefined) {\n // Position-based write - need to use r+ to preserve existing content\n const fh = await fsPromises.open(realPath, \"r+\");\n try {\n await fh.write(data, 0, data.length, position);\n } finally {\n await fh.close();\n }\n } else {\n // Replace entire content\n await fsPromises.writeFile(realPath, data);\n }\n } catch (err) {\n throw mapError(err, \"writeFile\");\n }\n },\n\n async truncateFile(path: string, size: number): Promise<void> {\n const realPath = toRealPath(path);\n\n try {\n await fsPromises.truncate(realPath, size);\n } catch (err) {\n throw mapError(err, \"truncateFile\");\n }\n },\n\n async getFileMetadata(\n path: string\n ): Promise<{ size: number; lastModified: number; type: string }> {\n const realPath = toRealPath(path);\n\n try {\n const stats = await fsPromises.stat(realPath);\n\n if (stats.isDirectory()) {\n throw new Error(\n \"[TypeMismatchError]getFileMetadata: expected file but found directory\"\n );\n }\n\n return {\n size: stats.size,\n lastModified: stats.mtimeMs,\n type: getMimeType(realPath),\n };\n } catch (err) {\n if (err instanceof Error && err.message.startsWith(\"[\")) {\n throw err;\n }\n throw mapError(err, \"getFileMetadata\");\n }\n },\n };\n}\n"
5
+ "import * as nodeFs from \"node:fs\";\nimport * as nodePath from \"node:path\";\nimport { lookup as mimeLookup } from \"mime-types\";\nimport type { FileSystemHandler } from \"./index.mjs\";\n\nexport interface NodeFileSystemHandlerOptions {\n /** Custom fs module (e.g., memfs for testing). Defaults to Node.js fs */\n fs?: typeof nodeFs;\n}\n\n/**\n * Create a FileSystemHandler backed by the Node.js filesystem\n *\n * @param rootPath - Absolute path to the root directory for the sandbox\n * @param options - Optional configuration\n * @returns FileSystemHandler implementation\n *\n * @example\n * import { createNodeFileSystemHandler } from \"@ricsam/isolate-fs\";\n *\n * const handler = createNodeFileSystemHandler(\"/tmp/sandbox\");\n *\n * // Use with createRuntime\n * const runtime = await createRuntime({\n * fs: { handler }\n * });\n */\nexport function createNodeFileSystemHandler(\n rootPath: string,\n options?: NodeFileSystemHandlerOptions\n): FileSystemHandler {\n const fs = options?.fs ?? nodeFs;\n const fsPromises = fs.promises;\n\n // Resolve the root path to ensure it's absolute\n const resolvedRoot = nodePath.resolve(rootPath);\n\n /**\n * Map a virtual path to a real filesystem path\n * Virtual paths always start with \"/\" and are relative to rootPath\n */\n function toRealPath(virtualPath: string): string {\n // Normalize the virtual path\n const normalized = nodePath.normalize(virtualPath);\n // Join with root, handling the leading slash\n const relativePath = normalized.startsWith(\"/\")\n ? normalized.slice(1)\n : normalized;\n return nodePath.join(resolvedRoot, relativePath);\n }\n\n /**\n * Map Node.js errors to DOMException-style error messages\n */\n function mapError(err: unknown, operation: string): Error {\n if (!(err instanceof Error)) {\n return new Error(`[Error]${operation} failed`);\n }\n\n const nodeError = err as NodeJS.ErrnoException;\n\n switch (nodeError.code) {\n case \"ENOENT\":\n return new Error(`[NotFoundError]${operation}: path not found`);\n case \"EISDIR\":\n return new Error(\n `[TypeMismatchError]${operation}: expected file but found directory`\n );\n case \"ENOTDIR\":\n return new Error(\n `[TypeMismatchError]${operation}: expected directory but found file`\n );\n case \"ENOTEMPTY\":\n return new Error(\n `[InvalidModificationError]${operation}: directory not empty`\n );\n case \"EEXIST\":\n return new Error(`[InvalidModificationError]${operation}: already exists`);\n case \"EACCES\":\n case \"EPERM\":\n return new Error(`[NotAllowedError]${operation}: permission denied`);\n default:\n return new Error(`[Error]${operation}: ${nodeError.message}`);\n }\n }\n\n /**\n * Get MIME type for a file based on extension\n */\n function getMimeType(filePath: string): string {\n const result = mimeLookup(filePath);\n return result || \"application/octet-stream\";\n }\n\n return {\n async getFileHandle(\n path: string,\n options?: { create?: boolean }\n ): Promise<void> {\n const realPath = toRealPath(path);\n\n try {\n const stats = await fsPromises.stat(realPath);\n if (stats.isDirectory()) {\n throw new Error(\n \"[TypeMismatchError]getFileHandle: expected file but found directory\"\n );\n }\n // File exists and is a file - success\n } catch (err) {\n const nodeError = err as NodeJS.ErrnoException;\n if (nodeError.code === \"ENOENT\") {\n if (options?.create) {\n // Create empty file\n await fsPromises.writeFile(realPath, \"\");\n return;\n }\n throw new Error(\"[NotFoundError]getFileHandle: file not found\");\n }\n throw mapError(err, \"getFileHandle\");\n }\n },\n\n async getDirectoryHandle(\n path: string,\n options?: { create?: boolean }\n ): Promise<void> {\n const realPath = toRealPath(path);\n\n try {\n const stats = await fsPromises.stat(realPath);\n if (!stats.isDirectory()) {\n throw new Error(\n \"[TypeMismatchError]getDirectoryHandle: expected directory but found file\"\n );\n }\n // Directory exists - success\n } catch (err) {\n const nodeError = err as NodeJS.ErrnoException;\n if (nodeError.code === \"ENOENT\") {\n if (options?.create) {\n // Create directory\n await fsPromises.mkdir(realPath, { recursive: true });\n return;\n }\n throw new Error(\n \"[NotFoundError]getDirectoryHandle: directory not found\"\n );\n }\n throw mapError(err, \"getDirectoryHandle\");\n }\n },\n\n async removeEntry(\n path: string,\n options?: { recursive?: boolean }\n ): Promise<void> {\n const realPath = toRealPath(path);\n\n try {\n const stats = await fsPromises.stat(realPath);\n\n if (stats.isDirectory()) {\n if (options?.recursive) {\n // Use rm with recursive for non-empty directories\n await fsPromises.rm(realPath, { recursive: true });\n } else {\n // Try rmdir for empty directories (will fail if not empty)\n await fsPromises.rmdir(realPath);\n }\n } else {\n // Use unlink for files\n await fsPromises.unlink(realPath);\n }\n } catch (err) {\n throw mapError(err, \"removeEntry\");\n }\n },\n\n async readDirectory(\n path: string\n ): Promise<Array<{ name: string; kind: \"file\" | \"directory\" }>> {\n const realPath = toRealPath(path);\n\n try {\n const entries = await fsPromises.readdir(realPath, {\n withFileTypes: true,\n });\n\n return entries.map((entry) => ({\n name: entry.name,\n kind: entry.isDirectory() ? (\"directory\" as const) : (\"file\" as const),\n }));\n } catch (err) {\n throw mapError(err, \"readDirectory\");\n }\n },\n\n async readFile(\n path: string\n ): Promise<{\n data: Uint8Array;\n size: number;\n lastModified: number;\n type: string;\n }> {\n const realPath = toRealPath(path);\n\n try {\n const [data, stats] = await Promise.all([\n fsPromises.readFile(realPath),\n fsPromises.stat(realPath),\n ]);\n\n if (stats.isDirectory()) {\n throw new Error(\n \"[TypeMismatchError]readFile: expected file but found directory\"\n );\n }\n\n return {\n data: new Uint8Array(data),\n size: stats.size,\n lastModified: stats.mtimeMs,\n type: getMimeType(realPath),\n };\n } catch (err) {\n if (err instanceof Error && err.message.startsWith(\"[\")) {\n throw err;\n }\n throw mapError(err, \"readFile\");\n }\n },\n\n async writeFile(\n path: string,\n data: Uint8Array,\n position?: number\n ): Promise<void> {\n const realPath = toRealPath(path);\n\n try {\n // Check file exists first (matches WHATWG semantics where file must exist via getFileHandle)\n await fsPromises.access(realPath);\n\n if (position !== undefined) {\n // Position-based write - need to use r+ to preserve existing content\n const fh = await fsPromises.open(realPath, \"r+\");\n try {\n await fh.write(data, 0, data.length, position);\n } finally {\n await fh.close();\n }\n } else {\n // Replace entire content\n const fh = await fsPromises.open(realPath, 'w');\n try {\n await fh.writeFile(data);\n } finally {\n await fh.close();\n }\n }\n } catch (err) {\n throw mapError(err, \"writeFile\");\n }\n },\n\n async truncateFile(path: string, size: number): Promise<void> {\n const realPath = toRealPath(path);\n\n try {\n await fsPromises.truncate(realPath, size);\n } catch (err) {\n throw mapError(err, \"truncateFile\");\n }\n },\n\n async getFileMetadata(\n path: string\n ): Promise<{ size: number; lastModified: number; type: string }> {\n const realPath = toRealPath(path);\n\n try {\n const stats = await fsPromises.stat(realPath);\n\n if (stats.isDirectory()) {\n throw new Error(\n \"[TypeMismatchError]getFileMetadata: expected file but found directory\"\n );\n }\n\n return {\n size: stats.size,\n lastModified: stats.mtimeMs,\n type: getMimeType(realPath),\n };\n } catch (err) {\n if (err instanceof Error && err.message.startsWith(\"[\")) {\n throw err;\n }\n throw mapError(err, \"getFileMetadata\");\n }\n },\n };\n}\n"
6
6
  ],
7
- "mappings": ";AAAA;AACA;AACA,mBAAS;AAyBF,SAAS,2BAA2B,CACzC,UACA,SACmB;AAAA,EACnB,MAAM,KAAK,SAAS,MAAM;AAAA,EAC1B,MAAM,aAAa,GAAG;AAAA,EAGtB,MAAM,eAAwB,iBAAQ,QAAQ;AAAA,EAM9C,SAAS,UAAU,CAAC,aAA6B;AAAA,IAE/C,MAAM,aAAsB,mBAAU,WAAW;AAAA,IAEjD,MAAM,eAAe,WAAW,WAAW,GAAG,IAC1C,WAAW,MAAM,CAAC,IAClB;AAAA,IACJ,OAAgB,cAAK,cAAc,YAAY;AAAA;AAAA,EAMjD,SAAS,QAAQ,CAAC,KAAc,WAA0B;AAAA,IACxD,IAAI,EAAE,eAAe,QAAQ;AAAA,MAC3B,OAAO,IAAI,MAAM,UAAU,kBAAkB;AAAA,IAC/C;AAAA,IAEA,MAAM,YAAY;AAAA,IAElB,QAAQ,UAAU;AAAA,WACX;AAAA,QACH,OAAO,IAAI,MAAM,kBAAkB,2BAA2B;AAAA,WAC3D;AAAA,QACH,OAAO,IAAI,MACT,sBAAsB,8CACxB;AAAA,WACG;AAAA,QACH,OAAO,IAAI,MACT,sBAAsB,8CACxB;AAAA,WACG;AAAA,QACH,OAAO,IAAI,MACT,6BAA6B,gCAC/B;AAAA,WACG;AAAA,QACH,OAAO,IAAI,MAAM,6BAA6B,2BAA2B;AAAA,WACtE;AAAA,WACA;AAAA,QACH,OAAO,IAAI,MAAM,oBAAoB,8BAA8B;AAAA;AAAA,QAEnE,OAAO,IAAI,MAAM,UAAU,cAAc,UAAU,SAAS;AAAA;AAAA;AAAA,EAO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AG;AAAA,UACvD,MAAM;AAAA,QACR;AAAA,QACA,MAAM,SAAS,KAAK,iBAAiB;AAAA;AAAA;AAAA,EAG3C;AAAA;",
8
+ "debugId": "5F70AB435AA05E2464756E2164756E21",
9
9
  "names": []
10
10
  }
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@ricsam/isolate-fs",
3
- "version": "0.1.10",
3
+ "version": "0.1.12",
4
4
  "type": "module"
5
5
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ricsam/isolate-fs",
3
- "version": "0.1.10",
3
+ "version": "0.1.12",
4
4
  "main": "./dist/cjs/index.cjs",
5
5
  "types": "./dist/types/index.d.ts",
6
6
  "exports": {
@@ -26,11 +26,12 @@
26
26
  "peerDependencies": {
27
27
  "isolated-vm": "^6"
28
28
  },
29
- "author": "Richard Samuelsson",
29
+ "author": "ricsam <oss@ricsam.dev>",
30
30
  "license": "MIT",
31
31
  "repository": {
32
32
  "type": "git",
33
- "url": "git+https://github.com/ricsam/isolate.git"
33
+ "url": "git+https://github.com/ricsam/isolate.git",
34
+ "directory": "packages/fs"
34
35
  },
35
36
  "bugs": {
36
37
  "url": "https://github.com/ricsam/isolate/issues"