coffee

execute scripts, compile .coffee files into .js, and provide an interactive REPL

TLDR

Run a script

$ coffee [path/to/file.coffee]
copy

Compile to JavaScript and save to a file with the same name

$ coffee --compile [path/to/file.coffee]
copy

Compile to JavaScript and save to a given output file

$ coffee --compile [path/to/file.coffee] --output [path/to/file.js]
copy

Start a REPL (interactive shell)

$ coffee --interactive
copy

Watch script for changes and re-run script

$ coffee --watch [path/to/file.coffee]
copy

SYNOPSIS

coffee [options] path/to/script.coffee -- [args]

DESCRIPTION

If called without options, `coffee` will run your script.

-b, --bare

compile without a top-level function wrapper

-c, --compile

compile to JavaScript and save as .js files

-e, --eval

pass a string from the command line as input

-h, --help

display this help message

-i, --interactive

run an interactive CoffeeScript REPL

-j, --join

concatenate the source CoffeeScript before compiling

-m, --map

generate source map and save as .js.map files

-M, --inline-map

generate source map and include it directly in output

-n, --nodes

print out the parse tree that the parser produces

--nodejs

pass options directly to the "node" binary

--no-header

suppress the "Generated by" header

-o, --output

set the output directory for compiled JavaScript

-p, --print

print out the compiled JavaScript

-r, --require

require the given module before eval or REPL

-s, --stdio

listen for and compile scripts over stdio

-l, --literate

treat stdio as literate style coffee-script

-t, --tokens

print out the tokens that the lexer/rewriter produce

-v, --version

display the version number

-w, --watch

watch scripts for changes and rerun commands

Copied to clipboard
Coindodo