PHPackages                             asko/elejs - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. asko/elejs

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

asko/elejs
==========

v0.0.5(1y ago)11[3 issues](https://github.com/askonomm/elejs/issues)MITPHPPHP ^8.4

Since Jan 19Pushed 1y ago1 watchersCompare

[ Source](https://github.com/askonomm/elejs)[ Packagist](https://packagist.org/packages/asko/elejs)[ RSS](/packages/asko-elejs/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (5)Dependencies (2)Versions (7)Used By (0)

EleJs
=====

[](#elejs)

A library that transforms PHP code into JavaScript code, enabling you to write your front-end in your back-end.

**Note** that it merely transforms PHP into JavaScript, meaning that the behavior of code changes according to the differences between the PHP and JavaScript runtimes. A lot of (most of) stuff is missing, especially when it comes to JS interop definitions. That said, a proof of concept is working, and demonstrates that it is indeed possible to transpile PHP into JavaScript.

Installation
------------

[](#installation)

```
composer require asko/elejs
```

Usage
-----

[](#usage)

```
use Asko\Js\Js;

$js = Js::fromFile('some-php-file.php');
```

Or:

```
use Asko\Js\Js;

$js = Js::fromString('
