Questions tagged [coffeescript]

A language that transpiles to JavaScript. Use this tag for questions about programming with the CoffeeScript language.

From the CoffeeScript Homepage:

CoffeeScript is a little language that compiles into JavaScript. Underneath that awkward Java-esque patina, JavaScript has always had a gorgeous heart. CoffeeScript is an attempt to expose the good parts of JavaScript in a simple way.

CoffeeScript can be used in any JavaScript environment. Included in a web page, it supports <script type="text/coffeescript"> tags; with node.js it can compile code on the command line, and it is also available as a Ruby gem.

The documentation and downloads can be found on the CoffeeScript website.

Common causes of unexpected behavior

  • Check your whitespace. Indentation is SIGNIFICANT. Mixing SPACE and TAB in indentation will create problems. Make sure you understand the rules for whitespace and make sure you triple-check this.

Popular questions

###Freely available CoffeeScript programming books

Video Tutorial

Codeschool CoffeeScript Tutorial - Awesome place to start with CoffeeScript.

9747 questions
3
votes
1 answer

Can't access WebDriverJS wait 'until' in Protractor and CoffeeScript

I need to wait for a modal to close so I am waiting for the absence of an element. I'm trying to do something like this: browser.driver.wait until.stalenessOf(By.css '.modal-header') Unfortunately Coffeescript has reserved until. So I tried…
Brennan Cheung
  • 4,271
  • 4
  • 30
  • 29
3
votes
1 answer

RaphaelJS - how to draw arrow-heads at the end of archs?

I'm working on a project using raphaelJS, I'm trying to draw arrows at both ends of an arch and while I have the arch down, but it's hard to get arrows. Thanks in advance for any input! the issue: how do you draw arrows at the end of curved raphael…
SJAndersonLA
  • 87
  • 1
  • 10
3
votes
3 answers

Elegant Javascript code for checking undefined values

So I have a callback function which provides a json object: function(object){ var data=object.packet.link.ip.tcp.data; console.log(data.toString()); } The problem I have is that any of packet/link/ip/tcp/data can be "undefined" - my node.js…
Eamorr
  • 9,872
  • 34
  • 125
  • 209
3
votes
1 answer

How to compile bootstrap-sass with gulp?

I've some problems with adding bootstrap to my node project. I installed bootstrap-sass-official via bower then I added gulp task for compiling bootstrap. I ran task which compiles bootstrap directly from a console and it was finished…
BILL
  • 4,711
  • 10
  • 57
  • 96
3
votes
2 answers

Why are both of these lines coming up the same color?

I feel like I'm going crazy here. I've been staring and staring and must be missing something obvious. See this example on jsbin I would like the curved path to be blue and the straight path underlying the word to be red. I noticed that I'm always…
George Mauer
  • 117,483
  • 131
  • 382
  • 612
3
votes
1 answer

Error: Use CoffeeScript.register() or require the coffee-script/register module to require .iced.md files

my app.js is: require("iced-coffee-script"); require("./serverOneNode.iced"); when I run it: node app.js got error: /projectPath/node_modules/iced-coffee-script/lib/coffee-script/coffee-script.js:200 throw new Error("Use…
Maxim Yefremov
  • 13,671
  • 27
  • 117
  • 166
3
votes
1 answer

Node Route.get() requires callback function but got a [object undefined]

I'm utilizing Passport to create a Google OAuth2 authentication system. I'm trying to write the route files in Coffeescript for it, except for some reason I keep getting this error:…
Andrew
  • 3,501
  • 8
  • 35
  • 54
3
votes
1 answer

package.json and bower.json in CoffeeScript?

I would like to write my package.json and bower.json in CoffeeScript. I'm using Gulp, but i'm very novice in writing Gulp tasks. How do i make NPM and Bower consume CoffeeScript configs? PS I failed to find how to override the path to Bower's and…
Andrey Mikhaylov - lolmaus
  • 23,107
  • 6
  • 84
  • 133
3
votes
1 answer

Angular - Unknown Provider from Provider

I have the strange issue, that somehow my own provider is not injecting correctly into my app. This is my provider: angular.module '1425App' .provider 'OData',[() -> @_baseUrl = '' return { setBaseUrl: (value) -> …
mlang
  • 159
  • 2
  • 13
3
votes
1 answer

passing data json in rails coffeescript and ajax

I tried different ways to retrieve json-data unsuccessfully my order.js.coffee $.ajax( url: "/orders/", // want "/orders/1" dataType: "JSON" ).done (data) -> console.log data.status my controller: class OrdersController <…
user3832640
  • 85
  • 1
  • 9
3
votes
1 answer

space and hash ( #) causing an error as a coffeescript regex?

The simplest way to express this question is with a small example in the repl: coffee> "hello".split(/: #/) #this is fine [ 'hello' ] coffee> "hello".split(/\s#/) #all good here too [ 'hello' ] coffee> "hello".split(/ #/) #wtf?? [stdin]:1:20:…
Mike H-R
  • 7,726
  • 5
  • 43
  • 65
3
votes
1 answer

Is there a way to run Plato on coffeescript

I've written all my server side code and Coffeescript and I'm wondering if there is a way to run Plato on it?
jwerre
  • 9,179
  • 9
  • 60
  • 69
3
votes
1 answer

Gulp Filter with SourceMaps

I had a similar question here that has merged into a bit more research on my part and a new way this could work. Basically I'm trying to have all of my .js and .coffee files within one gulp.src() object and based on the extension, do relevant tasks.…
Zach
  • 1,185
  • 3
  • 24
  • 60
3
votes
2 answers

chardinjs is not working in ruby on rails

Hello I try chardin js website for my project.but some how it is not worked.I am working on rails 3.2.14 and ruby 1.9.3 and chardin js version is 0.1.3, so please help me. Here i attach fiddle link. Edit: Same things tried on my project(in view).…
Ajay Barot
  • 1,681
  • 1
  • 21
  • 37
3
votes
1 answer

ExecJS::RuntimeError in Listings#index error

I'm receiving this ExecJS error message when I open my localhost, I don't know why, some help would be amazing. I got this on my localhost Showing /.../conektec/app/views/layouts/application.html.erb where line #6 raised: SyntaxError: [stdin]:6:16:…
bntzio
  • 1,274
  • 14
  • 27