2017 © Pedro Peláez
 

library coffeescript

PHP wrapper to execute coffeescript node package or fallback to a PHP alternative

image

nodejs-php-fallback/coffeescript

PHP wrapper to execute coffeescript node package or fallback to a PHP alternative

  • PHP
  • 4 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 15 % Grown

The README.md

coffeescript

Latest Stable Version Build Status StyleCI Test Coverage Code Climate, (*1)

PHP wrapper to execute coffee-script node package or fallback to a PHP alternative., (*2)

Usage

First you need composer if you have not already. Then get the package with composer require nodejs-php-fallback/coffeescript then require the composer autload in your PHP file if it's not already:, (*3)

<?php

use NodejsPhpFallback\CoffeeScript;

// Require the composer autload in your PHP file if it's not already.
// You do not need to if you use a framework with composer like Symfony, Laravel, etc.
require 'vendor/autoload.php';

$coffee = new CoffeeScript('path/to/my-coffee-script-file.coffee');

// Output to a file:
$coffee->write('path/to/my-js-file.js');

// Get JS contents:
$jsContents = $coffee->getResult();

// Output to the browser:
header('Content-type: text/javascript');
echo $coffee;

// You can also get Coffee-Script code from a string:
$coffee = new CoffeeScript('
alert "Foo"
');
// Then write JS with:
$coffee->write('path/to/my-js-file.js');
// or get it with:
$jsContents = $coffee->getResult();

// Pass false to the CoffeeScript constructor to wrap the rendered JS in a function, (else, the bare option is used):
$coffee = new CoffeeScript('path/to/my-coffee-script-file.coffee', false);

Security contact information

To report a security vulnerability, please use the Tidelift security contact. Tidelift will coordinate the fix and disclosure., (*4)

The Versions

07/09 2017

dev-master

9999999-dev

PHP wrapper to execute coffeescript node package or fallback to a PHP alternative

  Sources   Download

The Requires

 

The Development Requires

by Kyle

25/07 2016

1.0.0

1.0.0.0

PHP wrapper to execute coffeescript node package or fallback to a PHP alternative

  Sources   Download

The Requires

 

The Development Requires

by Kyle