Learn R Programming

js (version 1.2.1)

coffee_compile: Coffee Script

Description

Compiles coffee script into JavaScript.

Usage

coffee_compile(code, ...)

Arguments

code

a string with JavaScript code

...

additional options passed to the compiler

Examples

Run this code
# Hello world
coffee_compile("square = (x) -> x * x")
coffee_compile("square = (x) -> x * x", bare = TRUE)

# Simple script
demo <- readLines(system.file("example/demo.coffee", package = "js"))
js <- coffee_compile(demo)
cat(js)
cat(uglify_optimize(js))

Run the code above in your browser using DataLab