0

I have installed nodejs, installed coffee using npm and registered the environment variables and am now ready to compile my CoffeeScript into JavaScript for the first time.

I am running the following command in c:\MyCoffeeScriptProject\

coffee --compile --output js/

What happens next is that I get the interactive window and nothing in the "js" folder.

coffee>

I was expecting all .coffee files to be compiled into the "js" folder as .js files.

2 Answers 2

4

You didn't tell it which files to compile.

Usage: coffee [options] path/to/script.coffee [args]

Append a single period to the end for the current directory.

coffee --compile --output js/ .

It's easier to read if you rearrange it though.

coffee --output js/ --compile .

compiles all coffee files in . to js/

A common usage pattern is to have a src folder.

coffee --output js/ --compile src/
Sign up to request clarification or add additional context in comments.

Comments

1
c:/parent>coffee --output output  --compile src 

Where "output" is blank folder and "src" folder contains coffee files. Execute the command at level of src.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.