Question

Something like this is often seen in Gruntfiles, in the JS versions. I'm trying to re-write it in Coffeescript.

require('load-grunt-config')(grunt);

How would you write that in CoffeeScript? I'm not even sure what you'd call something like this.

Was it helpful?

Solution

It's better to write:

(require 'load-grunt-config') grunt

Then using parented as in this example:

require('load-grunt-config') (grunt) #This is ok
require ('load-grunt-config')(grunt) #This is what you do not want

Coffescipt is a whitespace syntactically sygnificant language.

OTHER TIPS

you are just requiring a function then executing it right away

require('load-grunt-config')(grunt)

or

require('load-grunt-config') grunt

same thing in coffeescript.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top