You're Invited:Meet the Socket Team at RSAC and BSidesSF 2026, March 23–26.RSVP
Socket
Book a DemoSign in
Socket

@php-wasm/node

Package Overview
Dependencies
Maintainers
7
Versions
219
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@php-wasm/node - npm Package Compare versions

Comparing version
3.0.40
to
3.0.41
+49
-20
index.cjs

@@ -48,23 +48,52 @@ "use strict";

async function getPHPLoaderModule(version = import_universal.LatestSupportedPHPVersion) {
switch (version) {
case "8.5":
return (await import("@php-wasm/node-8-5")).getPHPLoaderModule();
case "8.4":
return (await import("@php-wasm/node-8-4")).getPHPLoaderModule();
case "8.3":
return (await import("@php-wasm/node-8-3")).getPHPLoaderModule();
case "8.2":
return (await import("@php-wasm/node-8-2")).getPHPLoaderModule();
case "8.1":
return (await import("@php-wasm/node-8-1")).getPHPLoaderModule();
case "8.0":
return (await import("@php-wasm/node-8-0")).getPHPLoaderModule();
case "7.4":
return (await import("@php-wasm/node-7-4")).getPHPLoaderModule();
case "7.3":
return (await import("@php-wasm/node-7-3")).getPHPLoaderModule();
case "7.2":
return (await import("@php-wasm/node-7-2")).getPHPLoaderModule();
try {
switch (version) {
case "8.5":
return (await import("@php-wasm/node-8-5")).getPHPLoaderModule();
case "8.4":
return (await import("@php-wasm/node-8-4")).getPHPLoaderModule();
case "8.3":
return (await import("@php-wasm/node-8-3")).getPHPLoaderModule();
case "8.2":
return (await import("@php-wasm/node-8-2")).getPHPLoaderModule();
case "8.1":
return (await import("@php-wasm/node-8-1")).getPHPLoaderModule();
case "8.0":
return (await import("@php-wasm/node-8-0")).getPHPLoaderModule();
case "7.4":
return (await import("@php-wasm/node-7-4")).getPHPLoaderModule();
case "7.3":
return (await import("@php-wasm/node-7-3")).getPHPLoaderModule();
case "7.2":
return (await import("@php-wasm/node-7-2")).getPHPLoaderModule();
}
throw new Error(`Unsupported PHP version ${version}`);
} catch (errorCandidate) {
if (!errorCandidate || typeof errorCandidate !== "object") {
throw errorCandidate;
}
const error = errorCandidate;
if (error.message?.includes(
`SyntaxError: Cannot use 'import.meta' outside a module`
)) {
throw new Error(
`Node.js crashed on a 'import.meta' statement. This happens when running in a node:vm context. Some testing libraries like Jest use heavily customized runtime contexts, involving node:vm, jest-runtime, and custom require() implementations. These contexts do not support 'import.meta' statements and, by extension, cannot run the @php-wasm/node package. Consider using the --experimental-vm-modules flag or switching to a different test runner such as vitest.`,
{
cause: error
}
);
} else if (error?.code === `ERR_VM_DYNAMIC_IMPORT_CALLBACK_MISSING` || error?.code === `ERR_VM_DYNAMIC_IMPORT_CALLBACK_MISSING_FLAG` || error?.message?.includes(
`A dynamic import callback was invoked without --experimental-vm-modules`
) || error?.message?.includes(
`A dynamic import callback was not specified`
) || error?.message?.includes(`Must use import to load ES Module`)) {
throw new Error(
`Node.js crashed on a 'import()' statement. This happens when running in a node:vm context. Some testing libraries like Jest use runtime contexts, involving node:vm, jest-runtime, or other custom require() implementations. These contexts do not support import() statements and, by extension, cannot run the @php-wasm/node package. Consider using the --experimental-vm-modules flag or switching to a different test runner such as vitest.`,
{
cause: error
}
);
}
throw error;
}
throw new Error(`Unsupported PHP version ${version}`);
}

@@ -71,0 +100,0 @@

+49
-20

@@ -15,23 +15,52 @@ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {

async function getPHPLoaderModule(version = LatestSupportedPHPVersion) {
switch (version) {
case "8.5":
return (await import("@php-wasm/node-8-5")).getPHPLoaderModule();
case "8.4":
return (await import("@php-wasm/node-8-4")).getPHPLoaderModule();
case "8.3":
return (await import("@php-wasm/node-8-3")).getPHPLoaderModule();
case "8.2":
return (await import("@php-wasm/node-8-2")).getPHPLoaderModule();
case "8.1":
return (await import("@php-wasm/node-8-1")).getPHPLoaderModule();
case "8.0":
return (await import("@php-wasm/node-8-0")).getPHPLoaderModule();
case "7.4":
return (await import("@php-wasm/node-7-4")).getPHPLoaderModule();
case "7.3":
return (await import("@php-wasm/node-7-3")).getPHPLoaderModule();
case "7.2":
return (await import("@php-wasm/node-7-2")).getPHPLoaderModule();
try {
switch (version) {
case "8.5":
return (await import("@php-wasm/node-8-5")).getPHPLoaderModule();
case "8.4":
return (await import("@php-wasm/node-8-4")).getPHPLoaderModule();
case "8.3":
return (await import("@php-wasm/node-8-3")).getPHPLoaderModule();
case "8.2":
return (await import("@php-wasm/node-8-2")).getPHPLoaderModule();
case "8.1":
return (await import("@php-wasm/node-8-1")).getPHPLoaderModule();
case "8.0":
return (await import("@php-wasm/node-8-0")).getPHPLoaderModule();
case "7.4":
return (await import("@php-wasm/node-7-4")).getPHPLoaderModule();
case "7.3":
return (await import("@php-wasm/node-7-3")).getPHPLoaderModule();
case "7.2":
return (await import("@php-wasm/node-7-2")).getPHPLoaderModule();
}
throw new Error(`Unsupported PHP version ${version}`);
} catch (errorCandidate) {
if (!errorCandidate || typeof errorCandidate !== "object") {
throw errorCandidate;
}
const error = errorCandidate;
if (error.message?.includes(
`SyntaxError: Cannot use 'import.meta' outside a module`
)) {
throw new Error(
`Node.js crashed on a 'import.meta' statement. This happens when running in a node:vm context. Some testing libraries like Jest use heavily customized runtime contexts, involving node:vm, jest-runtime, and custom require() implementations. These contexts do not support 'import.meta' statements and, by extension, cannot run the @php-wasm/node package. Consider using the --experimental-vm-modules flag or switching to a different test runner such as vitest.`,
{
cause: error
}
);
} else if (error?.code === `ERR_VM_DYNAMIC_IMPORT_CALLBACK_MISSING` || error?.code === `ERR_VM_DYNAMIC_IMPORT_CALLBACK_MISSING_FLAG` || error?.message?.includes(
`A dynamic import callback was invoked without --experimental-vm-modules`
) || error?.message?.includes(
`A dynamic import callback was not specified`
) || error?.message?.includes(`Must use import to load ES Module`)) {
throw new Error(
`Node.js crashed on a 'import()' statement. This happens when running in a node:vm context. Some testing libraries like Jest use runtime contexts, involving node:vm, jest-runtime, or other custom require() implementations. These contexts do not support import() statements and, by extension, cannot run the @php-wasm/node package. Consider using the --experimental-vm-modules flag or switching to a different test runner such as vitest.`,
{
cause: error
}
);
}
throw error;
}
throw new Error(`Unsupported PHP version ${version}`);
}

@@ -38,0 +67,0 @@

@@ -14,2 +14,2 @@ import type { PHPLoaderModule, SupportedPHPVersion } from '@php-wasm/universal';

*/
export declare function getPHPLoaderModule(version?: SupportedPHPVersion): Promise<PHPLoaderModule>;
export declare function getPHPLoaderModule(version?: SupportedPHPVersion | string): Promise<PHPLoaderModule>;
{
"name": "@php-wasm/node",
"version": "3.0.40",
"version": "3.0.41",
"description": "PHP.wasm for Node.js",

@@ -41,3 +41,3 @@ "repository": {

"types": "index.d.ts",
"gitHead": "9f0041161949833466bbf857eacfa0ca7776e53e",
"gitHead": "638b025343c1cfee4f1b1732c0e05d286e67e136",
"engines": {

@@ -53,16 +53,16 @@ "node": ">=20.18.3",

"yargs": "17.7.2",
"@php-wasm/node-polyfills": "3.0.40",
"@php-wasm/universal": "3.0.40",
"@php-wasm/node-8-5": "3.0.40",
"@php-wasm/node-8-4": "3.0.40",
"@php-wasm/node-8-3": "3.0.40",
"@php-wasm/node-8-2": "3.0.40",
"@php-wasm/node-8-1": "3.0.40",
"@php-wasm/node-8-0": "3.0.40",
"@php-wasm/node-7-4": "3.0.40",
"@php-wasm/node-7-3": "3.0.40",
"@php-wasm/node-7-2": "3.0.40",
"@php-wasm/logger": "3.0.40",
"@php-wasm/util": "3.0.40",
"@wp-playground/common": "3.0.40"
"@php-wasm/node-polyfills": "3.0.41",
"@php-wasm/universal": "3.0.41",
"@php-wasm/node-8-5": "3.0.41",
"@php-wasm/node-8-4": "3.0.41",
"@php-wasm/node-8-3": "3.0.41",
"@php-wasm/node-8-2": "3.0.41",
"@php-wasm/node-8-1": "3.0.41",
"@php-wasm/node-8-0": "3.0.41",
"@php-wasm/node-7-4": "3.0.41",
"@php-wasm/node-7-3": "3.0.41",
"@php-wasm/node-7-2": "3.0.41",
"@php-wasm/logger": "3.0.41",
"@php-wasm/util": "3.0.41",
"@wp-playground/common": "3.0.41"
},

@@ -69,0 +69,0 @@ "packageManager": "npm@10.9.2",