Experimental JavaScript-to-PHP source-to-source transpiler (v0.2.4). Converts ES6 classes, arrow functions, template strings, loops, and core JS built-ins (Array, JSON, Math, Number, String, Function, Date) to PHP. Released as an experiment with no stable version cadence. Unlike full-featured transpilers like Babel, this is a proof-of-concept not intended for production use. The README explicitly advises against using it.
npm install beejs2phpNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates transpiling a simple ES6 class into PHP using the transpile() function.
Do not use in production. Consider alternatives like Babel or custom converters.
Seek actively maintained transpilers or rewrite manually.
Limit input JS to the subset of features listed in the README.
Use shell redirection: js2php input.js > output.php
Use import statement or require with .default: const js2php = require('js2php').default;Switch to import syntax as the package is ESM-only.
Remove or rewrite async functions before transpilation.
No dependency data recorded yet.