Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Examples of CoffeeScript in NodeJS?

As a pet project, I am trying to get familiar with NodeJS and CoffeeScript, and am finding it hard to get the ball rolling.

I've found plenty of examples of single-file super-simple apps like in CoffeeScript's examples folder, however, none of those really show what a full application would look like. I've also scrounged Google to no avail.

Do you have any examples of medium-sized, multi-file CoffeeScript/NodeJS apps I could learn from?

like image 831
Austin Hyde Avatar asked Jan 03 '11 06:01

Austin Hyde


People also ask

How do you write a CoffeeScript?

In general, we use parenthesis while declaring the function, calling it, and also to separate the code blocks to avoid ambiguity. In CoffeeScript, there is no need to use parentheses, and while creating functions, we use an arrow mark (->) instead of parentheses as shown below.

What can you do with CoffeeScript?

CoffeeScript is a programming language that compiles to JavaScript. It adds syntactic sugar inspired by Ruby, Python, and Haskell in an effort to enhance JavaScript's brevity and readability. Specific additional features include list comprehension and destructuring assignment.

How do I know if CoffeeScript is installed?

The coffee and cake commands will first look in the current folder to see if CoffeeScript is installed locally, and use that version if so. This allows different versions of CoffeeScript to be installed globally and locally.

Is CoffeeScript obsolete?

As of today, January 2020, CoffeeScript is completely dead on the market (though the GitHub repository is still kind of alive).


2 Answers

See this gist: https://gist.github.com/652819

Its pretty much an entire NodeJS app using the Express framework, Redis for session storage, Couchdb as the database and written in CoffeeScript. However, you are asking for code organization. That depends from developer to developer. I personally prefer Express. However if you prefer MVC style then see Geddy.

like image 98
Shripad Krishna Avatar answered Sep 29 '22 12:09

Shripad Krishna


GitHub is your friend:

  • https://github.com/stephank/orona (Game)
  • https://github.com/drewlesueur/simple-websocket (WebSockets)

And if you want even more, take a look at the listing for the Coffee-Script Language. I suppose that 95% of the projects there are related to Node.js at the moment.

like image 43
Ivo Wetzel Avatar answered Sep 29 '22 12:09

Ivo Wetzel