php-transpiler
v0.4.0
Published
:cactus: Transpiler API to convert php-parser AST to Javascript
Downloads
63
Readme
php-transpiler
Transpiler API to convert php-parser AST to Javascript
Installation
This library is distributed with npm :
npm install php-transpiler --save
Usage
// initialize the php parser factory class
var engine = require('php-parser');
var transpiler = require('php-transpiler');
var jsCode = transpiler.generate(
engine.parseCode('<?php echo "Hello World";')
);
console.log(jsCode);
Will output :
module.exports = function($php) {
$php.stdout.print ('hello world');
};
Misc
This library is released under BSD-3 license clause.