PacktLib: CoffeeScript Application Development

CoffeeScript Application Development

Credits

About the Author

Acknowledgements

About the Reviewers

www.PacktPub.com

Preface

Running a CoffeeScript Program

Installing Node.js

Using the installer

Testing our Node installation

Installing CoffeeScript

Our very first CoffeeScript code

Compiling from a CoffeeScript file

CoffeeScript support in the editor

Starting our web application

Summary

Writing Your First Lines of CoffeeScript

Following along with the examples

CoffeeScript basics

Calling functions

Control structures

Comparison operators

Arrays

Simple objects

Summary

Building a Simple Application

Building our application

String Interpolation

Defining functions

Adding dynamic behavior to our application

Switch statements

Summary

Improving Our Application

Checking if a value exists

Assigning multiple values at once

Advanced function arguments

Summary

Classes in CoffeeScript

Defining a class in CoffeeScript

Constructors

Calling methods statically on classes

Inheritance

Using CoffeeScript with other class libraries

Summary

Refactoring with Classes

The refactoring cycle

Structuring our data with classes

Managing display logic with classes

A final refactoring pass

Using inheritance while refactoring

Getting the green light

Summary

Advanced CoffeeScript Usage

Getting our context right

Saving our work with memoization

A new idiom: options objects

Summary

Going Asynchronous

Understanding asynchronous operations

Getting to know our remote API

Making an asynchronous request

Using a third-party library

Wrangling multiple asynchronous calls

Alternatives for managing asynchronous calls

Summary

Debugging

Discovering a problem

Working with source maps

Fixing the problem

Summary

Using CoffeeScript in More Places

CoffeeScript directly in the browser

CoffeeScript in the browser console

Using CoffeeScript with Rails

Using CoffeeScript with Brunch

Using CoffeeScript with Node.js

Summary

CoffeeScript on the Server

Running a server with CoffeeScript

Adding an endpoint for data

Using a database

Using a Cakefile

Making our application interactive

Summary

Index