Please note that these instructions are for busy developers, and assume that you are one. If so, this should help, if you’re not, these may not. Sorry about that. Below are the steps I used…
- First get npm (the node package manager).
- You’ll find a one line install such as this or similar:
curl http://npmjs.org/install.sh | sh
- Next CoffeeScript:
npm install -g coffee-script(Leave off the -g if you don’t wish to install globally.)
- Assuming that went well you should be able to type “coffee” on the command line and see a
- Pat yourself on the back and start developing! But wait, a little more structure might help… You can skip the steps below and check out the repository.
- Create a new folder and get it set up as a repository. For me that looks something like this:
mkdir ~/code/learning_coffeescript; cd ~/code/learning_coffeescript; git init;
- Create some files a bit of structure. A top level public directory and src directory. Inside public I created a lib dir and an index.html file.
- Back in the terminal, at your project root, type
- Assuming you’ve got everything wired up correctly, you can fire up a browser, open the index.html file and go to town.
- If you want to get snazzy you can
rackup file_server.ru -p 1111and the project will run under a basic Rack file server.
- If you wish to be all hip and edgy you can download and install Pow, symlink your local clone of the repository and develop to your hearts content.
Feel free to make pull requests, or send me issues, updates, or notes. I’m sure I have a lot to learn about CoffeeScript how best to integrate it with jQuery, etc. In the end though, I’m enjoying the syntax. It was just not clear how to get a project going. Next I’ll be looking at testing…