-
Notifications
You must be signed in to change notification settings - Fork 4
Shebang
jfraboni edited this page Oct 24, 2014
·
2 revisions
When writing our simple node apps, we’ll always include this line at top of javascript files:
#!/usr/bin/env node
On Unix like operating systems, this is called a Shebang, and is a sequence of characters located at the top of a file that start with:
#!
...and are followed by the directory path to, and name of, the interpreter that will run the script, in this case node. This allows us the run the script from the command line without having to explicitly state WHICH application we want to run our file. Normally, you'd have to do this:
$ node simple-node-app.js
...we can type:
$ ./simple-node-app.js
We've included the Node.js Shebang at the top of all our simple node lessons, so you don't have to type it now.
© 2014-2015 Operation Spark