Experimental JavaScript to PHP source-to-source transpiler (v0.3.2). Converts ES6 features (classes, arrow functions, template strings) and core JavaScript APIs (Array, JSON, Math, Number, String, Function) to PHP code, with partial Date support. The project is marked as experimental and not for production use. No active maintenance or recent releases.
npm install php-generatorNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Converts a JavaScript file with ES6 class and arrow function to PHP using the CLI tool.
Consider using alternative transpilers or rewriting code manually in PHP.
Check the converted PHP output carefully and manually fix any missing or incorrect implementations.
Do not use Date in JavaScript code intended for transpilation, or manually implement date handling in PHP.
Install globally: npm install -g js2php
Reinstall the package: npm install -g js2php
No dependency data recorded yet.