@php-wasm/node
Advanced tools
+18
-16
@@ -500,9 +500,12 @@ "use strict"; | ||
| } | ||
| phpRuntime.FS.mkdirTree(process.cwd()); | ||
| phpRuntime.FS.mount( | ||
| phpRuntime.FS.filesystems["NODEFS"], | ||
| { root: process.cwd() }, | ||
| process.cwd() | ||
| ); | ||
| phpRuntime.FS.chdir(process.cwd()); | ||
| const cwd = process.cwd(); | ||
| if (cwd && cwd !== "/") { | ||
| phpRuntime.FS.mkdirTree(cwd); | ||
| phpRuntime.FS.mount( | ||
| phpRuntime.FS.filesystems["NODEFS"], | ||
| { root: cwd }, | ||
| cwd | ||
| ); | ||
| phpRuntime.FS.chdir(cwd); | ||
| } | ||
| } | ||
@@ -744,3 +747,2 @@ }; | ||
| var import_util = require("@php-wasm/util"); | ||
| var import_path2 = require("path"); | ||
| async function loadNodeRuntime(phpVersion, options = {}) { | ||
@@ -765,5 +767,6 @@ let emscriptenOptions = { | ||
| ); | ||
| const normalizedPath = (0, import_util.toPosixPath)(absoluteSourcePath); | ||
| const symlinkMountPath = (0, import_util.joinPaths)( | ||
| `/internal/symlinks`, | ||
| absoluteSourcePath | ||
| normalizedPath | ||
| ); | ||
@@ -780,3 +783,3 @@ if (import_fs5.default.existsSync(absoluteSourcePath)) { | ||
| phpRuntime.FS.mkdirTree( | ||
| (0, import_path2.dirname)(symlinkMountPath) | ||
| (0, import_util.dirname)(symlinkMountPath) | ||
| ); | ||
@@ -827,6 +830,5 @@ phpRuntime.FS.writeFile(symlinkMountPath, ""); | ||
| emscriptenOptions = await withNetworking(emscriptenOptions); | ||
| return await (0, import_universal10.loadPHPRuntime)( | ||
| await getPHPLoaderModule(phpVersion), | ||
| emscriptenOptions | ||
| ); | ||
| const phpLoaderModule = await getPHPLoaderModule(phpVersion); | ||
| const runtimeId = await (0, import_universal10.loadPHPRuntime)(phpLoaderModule, emscriptenOptions); | ||
| return runtimeId; | ||
| } | ||
@@ -841,3 +843,3 @@ | ||
| var import_fs6 = require("fs"); | ||
| var import_path3 = require("path"); | ||
| var import_path2 = require("path"); | ||
| function createNodeFsMountHandler(localPath) { | ||
@@ -849,3 +851,3 @@ return function(php, FS, vfsMountPoint) { | ||
| if (lstat.isFile() || lstat.isSymbolicLink()) { | ||
| FS.mkdirTree((0, import_path3.dirname)(vfsMountPoint)); | ||
| FS.mkdirTree((0, import_path2.dirname)(vfsMountPoint)); | ||
| FS.writeFile(vfsMountPoint, ""); | ||
@@ -852,0 +854,0 @@ } else if (lstat.isDirectory()) { |
+16
-14
@@ -467,9 +467,12 @@ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, { | ||
| } | ||
| phpRuntime.FS.mkdirTree(process.cwd()); | ||
| phpRuntime.FS.mount( | ||
| phpRuntime.FS.filesystems["NODEFS"], | ||
| { root: process.cwd() }, | ||
| process.cwd() | ||
| ); | ||
| phpRuntime.FS.chdir(process.cwd()); | ||
| const cwd = process.cwd(); | ||
| if (cwd && cwd !== "/") { | ||
| phpRuntime.FS.mkdirTree(cwd); | ||
| phpRuntime.FS.mount( | ||
| phpRuntime.FS.filesystems["NODEFS"], | ||
| { root: cwd }, | ||
| cwd | ||
| ); | ||
| phpRuntime.FS.chdir(cwd); | ||
| } | ||
| } | ||
@@ -709,4 +712,3 @@ }; | ||
| // packages/php-wasm/node/src/lib/load-runtime.ts | ||
| import { joinPaths } from "@php-wasm/util"; | ||
| import { dirname } from "path"; | ||
| import { dirname, joinPaths, toPosixPath } from "@php-wasm/util"; | ||
| async function loadNodeRuntime(phpVersion, options = {}) { | ||
@@ -731,5 +733,6 @@ let emscriptenOptions = { | ||
| ); | ||
| const normalizedPath = toPosixPath(absoluteSourcePath); | ||
| const symlinkMountPath = joinPaths( | ||
| `/internal/symlinks`, | ||
| absoluteSourcePath | ||
| normalizedPath | ||
| ); | ||
@@ -792,6 +795,5 @@ if (fs5.existsSync(absoluteSourcePath)) { | ||
| emscriptenOptions = await withNetworking(emscriptenOptions); | ||
| return await loadPHPRuntime( | ||
| await getPHPLoaderModule(phpVersion), | ||
| emscriptenOptions | ||
| ); | ||
| const phpLoaderModule = await getPHPLoaderModule(phpVersion); | ||
| const runtimeId = await loadPHPRuntime(phpLoaderModule, emscriptenOptions); | ||
| return runtimeId; | ||
| } | ||
@@ -798,0 +800,0 @@ |
+17
-15
| { | ||
| "name": "@php-wasm/node", | ||
| "version": "3.0.46", | ||
| "version": "3.0.51", | ||
| "description": "PHP.wasm for Node.js", | ||
@@ -41,3 +41,3 @@ "repository": { | ||
| "types": "index.d.ts", | ||
| "gitHead": "845cbc01dba047db8bf0b4ae2670b924e3517087", | ||
| "gitHead": "ebc05da827807f3311ed1de8711fa74266183fab", | ||
| "engines": { | ||
@@ -53,14 +53,14 @@ "node": ">=20.18.3", | ||
| "yargs": "17.7.2", | ||
| "@php-wasm/node-polyfills": "3.0.46", | ||
| "@php-wasm/universal": "3.0.46", | ||
| "@php-wasm/node-8-5": "3.0.46", | ||
| "@php-wasm/node-8-4": "3.0.46", | ||
| "@php-wasm/node-8-3": "3.0.46", | ||
| "@php-wasm/node-8-2": "3.0.46", | ||
| "@php-wasm/node-8-1": "3.0.46", | ||
| "@php-wasm/node-8-0": "3.0.46", | ||
| "@php-wasm/node-7-4": "3.0.46", | ||
| "@php-wasm/logger": "3.0.46", | ||
| "@php-wasm/util": "3.0.46", | ||
| "@wp-playground/common": "3.0.46" | ||
| "@php-wasm/node-polyfills": "3.0.51", | ||
| "@php-wasm/universal": "3.0.51", | ||
| "@php-wasm/node-8-5": "3.0.51", | ||
| "@php-wasm/node-8-4": "3.0.51", | ||
| "@php-wasm/node-8-3": "3.0.51", | ||
| "@php-wasm/node-8-2": "3.0.51", | ||
| "@php-wasm/node-8-1": "3.0.51", | ||
| "@php-wasm/node-8-0": "3.0.51", | ||
| "@php-wasm/node-7-4": "3.0.51", | ||
| "@php-wasm/logger": "3.0.51", | ||
| "@php-wasm/util": "3.0.51", | ||
| "@wp-playground/common": "3.0.51" | ||
| }, | ||
@@ -76,3 +76,5 @@ "packageManager": "npm@10.9.2", | ||
| "tmp": "0.2.5", | ||
| "form-data": "^4.0.4" | ||
| "form-data": "^4.0.4", | ||
| "lodash": "^4.17.23", | ||
| "glob": "^9.3.0" | ||
| }, | ||
@@ -79,0 +81,0 @@ "optionalDependencies": { |
Network access
Supply chain riskThis module accesses the network.
Found 3 instances in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 3 instances in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
30927185
03555
0.11%+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
Updated
Updated
Updated
Updated
Updated
Updated
Updated
Updated
Updated
Updated
Updated