nodejs-php-fallback/coffeescript 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

nodejs-php-fallback/coffeescript

最新稳定版本:1.0.1

Composer 安装命令:

composer require nodejs-php-fallback/coffeescript

包简介

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

README 文档

README

Latest Stable Version Build Status StyleCI Test Coverage Code Climate

PHP wrapper to execute coffee-script node package or fallback to a PHP alternative.

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:

<?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.

统计信息

  • 总下载量: 115.86k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 5
  • 点击次数: 1
  • 依赖项目数: 4
  • 推荐数: 0

GitHub 信息

  • Stars: 5
  • Watchers: 1
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-07-25