https://github.com/glayzzle/php-transpiler
:cactus: Transpiler API to convert php-parser AST to Javascript
https://github.com/glayzzle/php-transpiler
javascript language php transpiler
Last synced: about 1 year ago
JSON representation
:cactus: Transpiler API to convert php-parser AST to Javascript
- Host: GitHub
- URL: https://github.com/glayzzle/php-transpiler
- Owner: glayzzle
- License: bsd-3-clause
- Created: 2017-01-20T11:29:05.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-05-04T19:00:15.000Z (about 9 years ago)
- Last Synced: 2025-04-22T14:54:17.587Z (about 1 year ago)
- Topics: javascript, language, php, transpiler
- Language: JavaScript
- Homepage: http://glayzzle.com/php-transpiler/
- Size: 211 KB
- Stars: 22
- Watchers: 4
- Forks: 5
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# php-transpiler
Transpiler API to convert [php-parser](https://github.com/glayzzle/php-parser) AST to a Javascript output. This library is used to run a php script with :
- [PHP Runtime](https://github.com/glayzzle/php-runtime) - the API compliant with PHP Transpiler output
- [Glayzzle](https://github.com/glayzzle/glayzzle) - the nodejs CLI that runs PHP Files
[](https://www.npmjs.com/package/php-transpiler)
[](https://travis-ci.org/glayzzle/php-transpiler)
[](https://coveralls.io/github/glayzzle/php-transpiler?branch=master)
[](https://gitter.im/glayzzle/Lobby)
Installation
------------
This library is distributed with [npm](https://www.npmjs.com/package/php-transpiler) :
```sh
npm install php-transpiler --save
```
Usage
-----
```js
// initialize the php parser factory class
var transpiler = require('php-transpiler');
var instance = new transpiler({
browser: true // says if we generate code for browser or nodejs
});
var jsCode = instance.read('