Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

General Discussion

I want a gulp task that will run a JavaScript file! Can this be done?

I want to be able to the type "gulp runcode" in the console. This than would run a JavaScript file that I wrote.

Basically I'm trying to avoid having to write this long command line when going from one computer to the other. So I can just run a task file depending on computer I'm on.

Normally, I would write: node "XXXXXX\XXXXX\XXX\app.js"

but at another location I might write: node "XXXXX/XXX/X/XX/XX/app.js"

So the task would be base on if I'm on the server verses local computer.

Is this possible?