Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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?