espresso-transformer
A coffee to ES2015 code converter
Last updated 4 years ago by hipsterbrown .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install espresso-transformer 
SYNC missed versions from official npm registry.

Espresso

A quick shot of ES6 instead that old Coffee.

This is a command line tool for converting CoffeeScript files into their ES6 equivalents*.

*As close as possible, anyway.

Available through NPM

npm install espresso-transformer

Using as CLI: Espresso will look for .coffee files if a directory is passed in as the first argument, and write the new .es6 files to the same directory.

(Given there is a directory called coffeescript)

espresso coffeescript/

To add the JSX transformer:

espresso coffeescript/ --jsx

To change which files to look for:

espresso coffeescript/ --match .coffeescript

To change the file type being written after transformation:

espresso coffeescript/ --extension .js

Transformers

Core (default) transformer includes:

  • CommonJS requires -> ES2015 imports
  • CommonJS module.exports -> ES2015 export default
  • CoffeeScript fat arrow function => ES2015 fat arrow function
  • ES5 property function -> ES2015 object method

JSX transformer includes:

  • React.DOM elements -> JSX element
  • React component factory -> JSX element
  • React.createElement -> JSX element

Backbone Classes transformer:

  • converts Backbone Classes created with CoffeScript into their Backbone.Class.extend() equivalent

Up and Running (Development)

After cloning this repo:

npm install
npm link
espresso --help

Current Tags

  • 1.4.5                                ...           latest (4 years ago)

24 Versions

  • 1.4.5                                ...           4 years ago
  • 1.4.4                                ...           4 years ago
  • 1.4.3                                ...           4 years ago
  • 1.4.2                                ...           4 years ago
  • 1.4.1                                ...           4 years ago
  • 1.4.0                                ...           4 years ago
  • 1.3.6                                ...           4 years ago
  • 1.3.5                                ...           4 years ago
  • 1.3.4                                ...           4 years ago
  • 1.3.3                                ...           4 years ago
  • 1.3.2                                ...           4 years ago
  • 1.3.1                                ...           4 years ago
  • 1.3.0                                ...           4 years ago
  • 1.2.4                                ...           4 years ago
  • 1.2.3                                ...           4 years ago
  • 1.2.2                                ...           4 years ago
  • 1.2.1                                ...           4 years ago
  • 1.2.0                                ...           4 years ago
  • 1.1.4                                ...           4 years ago
  • 1.1.3                                ...           4 years ago
  • 1.1.2                                ...           4 years ago
  • 1.1.1                                ...           5 years ago
  • 1.1.0                                ...           5 years ago
  • 1.0.0                                ...           5 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (4)
Dev Dependencies (8)
Dependents (1)

Copyright 2014 - 2016 © taobao.org |