Useful CoffeeScript resources

A collection of useful resources to help you master CoffeeScript


Making Your First Coffee Module

To create a module that can be loaded with Bob = require './bob', put this code in bob.coffee:

class Bob

module.exports = Bob

You can find more information about modules in the Node documentation.

Visual Studio on Windows

If you have a paid version of Visual Studio, you can download a Visual Studio solution that is already set up to work with CoffeeScript and the other languages that Visual Studio supports.

Solution Explorer

  1. Download the Exercism.io Visual Studio Template from GitHub by clicking the Download Zip button on the page.
  2. Unzip the template into your exercises directory, for example C:\src\exercises
  3. Install the Exercism CLI
  4. Open a command prompt to your exercise directory
  5. Add your API key to exercism exercism configure --key=YOUR_API_KEY
  6. Configure your source directory in exercism exercism configure --dir=C:\src\exercises
  7. Fetch your first exercise exercism fetch coffeescript
  8. Open the Exercism solution in Visual Studio
  9. Expand the Exercism.coffeescript project
  10. Click on Show All Files in Solution Explorer (See below)
  11. The exercise you just fetched will appear greyed out. Right click on the folder and Include In Project
  12. Get coding...

Add files

To work with CoffeeScript in Visual Studio, you should install the Web Essentials extension. It will also make working with Javascript much easier.

You can run the unit tests from a node.js command line using the batch file in the project.

C:\Src\exercises\coffeescript> test example\bob_test.spec.coffee
.................

Finished in 0.02 seconds
17 tests, 17 assertions, 0 failures, 0 skipped

If you do not see any output from running the tests, you are likely not in a Node.js command prompt.

Check out our learning resources.

Support