Giter Site home page Giter Site logo

coffeehaus's Introduction

coffeehaus

A coffeescript shop for JVM locals.

/!\ Extraction in progress

This library is the extraction of the coffeescript compiler used in coffeescripted-sbt for use as a standalone library

install

(todo)

usage

This library provides scala interfaces for compiling vanilla and iced CoffeeScript. It uses the versions 1.6.3 and 1.6.3-b respectively.

To compile vanilla coffeescript

coffeehaus.Compile.vanilla()("alert 'vanilla'")

or simply

coffeehaus.Compile("alert 'vanilla'")

To compile iced coffeescript

coffeehaus.Compile.iced()("alert 'iced'")

These will return a Either[coffeehaus.CompilerError, String] with the compiled source.

Don't have time to wait while your coffee's being brewed? Try moving to the side of the counter.

import coffeehaus.Compile
import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.Future
Future(Compile("alert 'vanilla'")).map { coffee =>
  Thread.sleep(1000)
  coffee.fold(println, println)
}
println("checkin' my tweets")

Be Your Own Barista

This library will always make a best attempt at providing interfaces to the latest coffeescript compilers.

That doesn't mean you can't experiment with your own brews ( other versions of coffeescript ) by extending coffeehaus.Compile providing a resource path to the source of the script. As an example the built-in vanilla coffeescript compiler is defined as follows

Vanilla extends Compile("vanilla/coffee-script.js")

enjoy.

Doug Tangren (softprops) 2013

coffeehaus's People

Contributors

softprops avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.