coffee_compile | R Documentation |
Compiles coffee script into JavaScript.
coffee_compile(code, ...)
code |
a string with JavaScript code |
... |
additional options passed to the compiler |
# 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))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.