A source-to-source transpiler that converts JavaScript (including ES6 features like classes, arrow functions, template strings, and namespaces) into PHP code. Current version 0.1.7-c is marked as experimental and not recommended for production use. It provides a CLI tool for file conversion and supports core JavaScript constructs, Array/JSON/Math/String methods, and Date. Maintained as a hobby project with no recent releases or active development.
npm install javascript-to-phpNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Install the CLI tool globally and convert a JavaScript file to PHP, then optionally run the PHP output.
Do not use in production. Consider alternative tools or manual translation.
Use a maintained transpiler or avoid reliance on this package.
Only simple ES6 constructs are supported. Use a more comprehensive transpiler if needed.
Run `npm install -g javascript-to-php` to install globally.
Ensure npm global bin is in PATH or install locally via `npx javascript-to-php`.