Last active
January 1, 2016 04:09
-
-
Save zakdances/8090048 to your computer and use it in GitHub Desktop.
js2coffee cheatsheet
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
js2coffee file.js > file.coffee -V -it -sq | |
# The help banner that is printed when `js2coffee` is called without arguments. | |
BANNER = """ | |
Usage: js2coffee [options] path/to/script.js | |
js2coffee file.js | |
js2coffee file.js > output.coffee | |
cat file.js | js2coffee | |
""" | |
knownOpts = | |
version: Boolean # show js2coffee version | |
verbose: Boolean # be verbose | |
no_comments: Boolean # do not translate comments | |
show_src_lineno: Boolean # show src lineno's as comments | |
single_quotes: Boolean # use single quoted string literals | |
help: Boolean # if you need help | |
indent: String # set indent character(s), default two spaces | |
shortHands = | |
v: ["--version"] | |
V: ["--verbose"] | |
X: ["--no_comments"] | |
l: ["--show_src_lineno"] | |
h: ["--help"] | |
sq: ["--single_quotes"] | |
i4: ["--indent", " "] | |
it: ["--indent", "\t"] | |
# The list of all the valid option flags that `js2coffee` knows how to handle. | |
description = | |
version: 'Show js2coffee version' | |
verbose: 'Be verbose' | |
no_comments: 'Do not translate comments' | |
show_src_lineno: 'Show src lineno\'s as comments' | |
help: 'If you need help' | |
single_quotes: "Use single quoted string literals - default double quoted" | |
indent: 'Specify the indent character(s) - default 2 spaces' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment