PHPackages                             kylekatarnls/coffeescript - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. kylekatarnls/coffeescript

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

kylekatarnls/coffeescript
=========================

A port of the CoffeeScript compiler to PHP. (See http://github.com/alxlit/coffeescript-php, this is an exact fork to fix minimum stability on the last release)

1.3.4(9y ago)2139.3k↓36.2%5MITPHPPHP &gt;=5.3.0

Since Apr 7Pushed 9y ago1 watchersCompare

[ Source](https://github.com/kylekatarnls/coffeescript-php)[ Packagist](https://packagist.org/packages/kylekatarnls/coffeescript)[ Docs](http://github.com/kylekatarnls/coffeescript-php)[ RSS](/packages/kylekatarnls-coffeescript/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (3)DependenciesVersions (6)Used By (5)

CoffeeScript PHP
================

[](#coffeescript-php)

A port of the [CoffeeScript](http://jashkenas.github.com/coffee-script/)compiler to PHP.

Status
------

[](#status)

CoffeeScript version **1.3.1** has been fully ported over (see [tags](http://github.com/alxlit/coffeescript-php/tags)). There are a couple benign differences between the port's compiled code and the reference's (for example [\#11](https://github.com/alxlit/coffeescript-php/issues/11)), otherwise they match 100%.

Requirements
------------

[](#requirements)

PHP 5.3+ (uses namespaces, anonymous functions).

Install
-------

[](#install)

It's recommended that you use [Composer](http://getcomposer.org) to install and autoload CoffeeScript. Alternatively you can load it manually:

```

```

Usage
-----

[](#usage)

The API is really basic (single `compile($coffee, $options = NULL)` function). I don't plan on expanding it further (keeping it simple). Here are the available options:

- **filename** - The source filename, formatted into error messages
- **header** - Add a "Generated by..." header
- **bare** - If set to `true`, the generated Javascript won't be embedded in a [IIFE](http://benalman.com/news/2010/11/immediately-invoked-function-expression/)
- **rewrite** - Enable the rewriter (debugging)
- **tokens** - Reference to token stream (debugging)
- **trace** - File to write parser trace to (debugging)

```

```

Development
-----------

[](#development)

To rebuild the parser run `php make.php`. Tests are run in the browser; simply clone the repository somewhere Apache can see it and navigate to tests/.

FAQ
---

[](#faq)

#### What was the motivation for this project?

[](#what-was-the-motivation-for-this-project)

I was using PHP a lot at the time and wanted to use, learn more about, and potentially contribute to the CoffeeScript project. I thought it'd be nice to have a native version gave it a shot.

#### Why not modify the original compiler to emit PHP?

[](#why-not-modify-the-original-compiler-to-emit-php)

For a number of reasons... First, I don't know why you'd want something like that. If you find PHP intolerable, just don't use it... Second, the original compiler depends on Jison, which is written in JavaScript, so you'd have to do something about that. Third, I think it'd be much more work to try and sort out all the differences between JavaScript and PHP (object model, core classes and libraries, etc).

#### What parser generator are you using?

[](#what-parser-generator-are-you-using)

Since there's no PHP port of Bison (which the reference compiler uses), we're using a port of Lemon called [ParserGenerator](http://pear.php.net/package/PHP_ParserGenerator).

It's included locally since the PEAR package is unmaintained and seems to be broken. In addition, some minor changes have been made to the parser template (Lempar.php) and the actual generator.

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity33

Limited adoption so far

Community20

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 92.9% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~421 days

Total

5

Last Release

3470d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/df90c422f521bf26355c3e185a59fe7afb35531af56244dfaec03ee1d0ca6f24?d=identicon)[kylekatarn](/maintainers/kylekatarn)

---

Top Contributors

[![alxlit](https://avatars.githubusercontent.com/u/361093?v=4)](https://github.com/alxlit "alxlit (144 commits)")[![bfanger](https://avatars.githubusercontent.com/u/207248?v=4)](https://github.com/bfanger "bfanger (4 commits)")[![kylekatarnls](https://avatars.githubusercontent.com/u/5966783?v=4)](https://github.com/kylekatarnls "kylekatarnls (2 commits)")[![jkrecek](https://avatars.githubusercontent.com/u/389734?v=4)](https://github.com/jkrecek "jkrecek (1 commits)")[![kochb](https://avatars.githubusercontent.com/u/1012892?v=4)](https://github.com/kochb "kochb (1 commits)")[![olivierphi](https://avatars.githubusercontent.com/u/722388?v=4)](https://github.com/olivierphi "olivierphi (1 commits)")[![briannesbitt](https://avatars.githubusercontent.com/u/170745?v=4)](https://github.com/briannesbitt "briannesbitt (1 commits)")[![cschramm](https://avatars.githubusercontent.com/u/464848?v=4)](https://github.com/cschramm "cschramm (1 commits)")

---

Tags

javascriptJScoffeecoffeescript

### Embed Badge

![Health badge](/badges/kylekatarnls-coffeescript/health.svg)

```
[![Health](https://phpackages.com/badges/kylekatarnls-coffeescript/health.svg)](https://phpackages.com/packages/kylekatarnls-coffeescript)
```

###  Alternatives

[matthiasmullie/minify

CSS &amp; JavaScript minifier, in PHP. Removes whitespace, strips comments, combines files (incl. @import statements and small assets in CSS files), and optimizes/shortens a few common programming patterns.

2.0k30.5M336](/packages/matthiasmullie-minify)[nostalgiaz/bootstrap-switch

Turn checkboxes and radio buttons into toggle switches.

5.0k362.3k4](/packages/nostalgiaz-bootstrap-switch)[stolz/assets

An ultra-simple-to-use assets management library

296519.2k8](/packages/stolz-assets)[tholu/php-packer

A PHP version of Packer, JavaScript obfuscation library originally created by Dean Edwards

137441.2k5](/packages/tholu-php-packer)[efficiently/larasset

Larasset is a library for Laravel 5 which manage assets in an easy way.

684.8k](/packages/efficiently-larasset)[trentrichardson/cakephp-shrink

Compiles, combines, and minifies javascript, coffee, less, scss, and css

1619.3k](/packages/trentrichardson-cakephp-shrink)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
