15

When I run express app_name, expressjs creates all the folders and files needed. I'm wondering if there's a way to do the same but instead of creating the app.js in JS, it creates in CoffeeScript.

Thanks

5 Answers 5

12

Try this: https://github.com/twilson63/express-coffee

express-coffee is a template or boiler-plate to get started writing express web applications in CoffeeScript. It comes ready to go with base setup for an Express Web App. It includes a Cakefile that lets you build, spec, and watch your coffeescript as you develop. You hack in the src folder and run cake build to build you server files, write your mocha in your test folder and run cake test or spec to run your test suite. Create your jade views in the views folder and put your public assets in the public folder...

Sign up to request clarification or add additional context in comments.

1 Comment

Is this still the best answer? I ask because I get errors when trying to use this with node v4.2.1 - and, with a few exceptions, the last time most of the files were updated in that project was 3-4 years ago...
8

You may want to check out skeleton. I also created frappe, which is similar but tweaked for my taste.

2 Comments

I'm using frappe and love it. Found it from this post. Thanks David.
Awesome. I'm glad you like it. :)
2

I don't think there's a command-line tool to do this, but there are plenty of template projects you could start from. In particular, I'd recommend sstephenson's node-coffee-project. It's not Express specific, but you can easily throw Express into the package.json and create a src/app.coffee file that looks something like

express = require 'express'
app = express.createServer()
# TODO: configuration
app.listen 3000

The important thing is to have a Cakefile that can do the tasks your project needs. For an Express project, you might want to add a task that not only continuously recompiles your CoffeeScript, but also restarts the server every time you change a source file. Here's a gist of a Cakefile I'm using on one of my projects (you'll have to add "watch-tree" to your `devDependencies).

Comments

1

ExpressOnSteroids Express + SCSS + COFFEE SCRIPT

clone project and start cake task /path/to/cake dev

Comments

0

just found that there is a project called 'zappa' on github that might be helpful to you http://zappajs.org

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.