Fenton
Fenton

Reputation: 250952

CoffeeScript Compile On Windows With NodeJS

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.

Upvotes: 0

Views: 990

Answers (2)

user2758406
user2758406

Reputation: 596

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.

Upvotes: 1

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/

Upvotes: 4

Related Questions