js-to-php-transpiler
v1.0.1
Published
A simple transpiler that converts JavaScript code to PHP.
Readme
JS to PHP Transpiler
A simple transpiler that converts JavaScript code to PHP. It supports both single file and directory transpilation, with an optional watch mode to monitor changes in source files.
Check out the demo project showcasing its usage: 👉 React SSR in WordPress
⚠️ Note: This is a fun experiment only. Not intended for production use.
Installation
npm install js-to-php-transpilerUsage
Build
js2php <source> <dest>Watch Mode
js2php -w <source> <dest>
js2php --watch <source> <dest>Examples
# Transpile a single file
js2php ./src/app.js ./build/app.php
# Transpile a directory
js2php ./src ./build
# Watch for changes
js2php -w ./src ./buildLicense
MIT License.
