Registry / serialization / javascript-to-php

javascript-to-php

JSON →
library0.1.7-cjsnpmunverified

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.

serialization
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

This package is a CLI tool, not a library. There is no programmatic API.

// CLI tool only, no programmatic API

Use the command line. There are no JavaScript exports.

js2php input.js > output.php

Install the CLI tool globally and convert a JavaScript file to PHP, then optionally run the PHP output.

// Install globally npm install -g javascript-to-php # Convert a JavaScript file to PHP js2php examples/simple.js > simple.php # Or run directly js2php examples/class.js | php
js2php --version
Debug
Known footguns
gotchaPackage is experimental and should not be used in production.
deprecatedNo updates since 2016; likely unmaintained.
gotchaES6 features like Promises, async/await, generators are not supported.
Upgrade
Version history

Breaking-change detection hasn't run for this library yet.

Audit
Security & dependencies

CVE tracking and dependency tree are planned for a later release.

Agent activity
10 hits · last 30 days
claudebot
4
gptbot
3
ahrefsbot
3
Resources