PHP code example of nvan / php-babel-transpiler

1. Go to this page and download the library: Download nvan/php-babel-transpiler library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

nvan / php-babel-transpiler example snippets



// Autoload or piler\Transpiler;

$transpiler = new Transpiler('Path/To/Babel'); // Can be relative or absolute

$transpiledString = $transpiler->transpile('class Test {}');
$transpiledFile = $transpiler->transpileFile('Path/To/File.js');
bash
$ composer