A simple transpiler that converts JavaScript code to PHP. Version 1.0.1 is the current stable release with no clear release cadence. It supports single file and directory transpilation, with an optional watch mode. This tool is explicitly marked as a fun experiment not intended for production use, differentiating it from serious transpilers like Babel or TypeScript compiler. It is primarily a CLI tool with no programmatic API documented, and it does not support most modern JavaScript features.
npm install js-to-php-transpilerNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates transpiling a simple JavaScript file to PHP using the CLI tool.
Do not use in production environments. Use established transpilers (e.g., Babel) for serious work.
If you need a programmatic API, fork the package or use another transpiler.
Test your JavaScript code thoroughly. Simplify complex constructs or avoid using modern JS features.
Run 'npm install -g js-to-php-transpiler' or use npx: 'npx js2php ...'
Rewrite the code using only basic ES5 constructs; avoid modern JS features.
Usage: js2php <source> <dest>. Ensure both arguments are provided.
No dependency data recorded yet.