Project

js2coffee

0.0
No commit activity in last 3 years
No release in over 3 years
Convert yours JavaScript code to CoffeeScript, vice versa.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 0.4

Runtime

~> 1.1
~> 2.2
 Project Readme

js2coffee Build Status Gem Version

Convert yours JavaScript to CoffeeScript, vice versa, just for ruby developer.

Philosophy

  • Keep it simple, a command line with no more options.
  • Pretty format output with coderay.
  • Watch a directory, convert automaticly when file change.
  • SourceMap generation automaticly, for debug with CoffeeScript in Firefox/Chrome.
  • With Nodejs, just for Ruby on Rails developer.

Getting Started

Install via Rubygems

$ gem install js2coffee

Usage

Run js2coffee or js2coffee individually. (old command coff is not available.)

Compile script file to STDOUT.

$ coffee2js your_awesome.coffee

You can redirect STDOUT to a new file.

$ coffee2js your_awesome.coffee > you_awesome.js

File

Watching one directory

$ coffee2js script_directory

This will create corresponding js(.js) and Source Map(.js.map) in same directory as coffee file live in. map file will keep hide with leading dot, e.g. awesome.js will create awesome.coffee and .awesome.js.map

Monitor

If one directory named coffee or named js in you project root, will create another directory automaticly with cloned directory hierarchy, this will make js and coffee file saved seperately.

Monitor

Compile script directly

You can run coffee script directly with: -e argments or pipe.

File File

Environment variable

You can setting JS2COFFEE_EXCLUDE_PATTERN to specify the pattern to be skipped when watching one directory.

$ export JS2COFFEE_EXCLUDE_PATTERN='one_pattern|another_pattern'

js2coffee will always skip node_modules and bower_components.

Support

  • MRI 1.9.3+
  • Rubinius 2.2+

Compiler current used:

History

More update info, please See CHANGELOG for details.

Contributing

  • Bug reports
  • Source
  • Patches:
    • Fork on Github.
    • Run gem install --dev js2coffee or bundle.
    • Create your feature branch: git checkout -b my-new-feature.
    • Commit your changes: git commit -am 'Add some feature'.
    • Push to the branch: git push origin my-new-feature.
    • Send a pull request :D.

license

Released under the MIT license, See LICENSE for details.