PacktLib: CoffeeScript Programming with jQuery, Rails, and Node.js

CoffeeScript Programming with jQuery, Rails, and Node.js

Credits

About the Author

About the Reviewers

www.PacktPub.com

Preface

Why CoffeeScript?

CoffeeScript syntax

CoffeeScript has great function syntax

CoffeeScript handles scope better

CoffeeScript has better object syntax

A few other things CoffeeScript fixes

List comprehensions

Conditional clauses and logical aliases

Array slicing and splicing

Destructuring or pattern matching

=> and @

Switch statements

Chained comparisons

Block strings, block comments, and strings

Summary

Running CoffeeScript

The CoffeeScript stack

Node.js and npm

Node.js, npm, and CoffeeScript on Windows

Installing CoffeeScript on a Mac

Installing CoffeeScript on Linux

Building Node.js from source

Using CoffeeScript

The coffee command

Summary

CoffeeScript and jQuery

Finding and changing elements

Utility functions

Ajax methods

Using jQuery

Using CoffeeScript and jQuery in the browser

Our application

Summary

CoffeeScript and Rails

What makes Rails special?

Rails and JavaScript

Rails and CoffeeScript

Installing Rails

Developing our Rails application

Summary

CoffeeScript and Node.js

Node is event-driven

Node is fast and scalable

Node is not Rails

Node and CoffeeScript

"Hello World" in Node

Express

WebSocket

Jade

Our application

Let's get started

Creating a view

node-supervisor

The to-do list view

The client side

Adding collaboration

Creating the collaboration UI

WebSocket on the client

WebSocket on the server

Joining a list

Adding to-do items to a shared list

Removing to-do items from a shared list

Summary

Index