What exactly does “/usr/bin/env node” do at the beginning of node files?

#!/usr/bin/env node is an instance of a shebang line: the very first line in an executable plain-text file on Unix-like platforms that tells the system what interpreter to pass that file to for execution, via the command line following the magic #! prefix (called shebang). Note: Windows does not support shebang lines, so they’re effectively … Read more

Node.js – EJS – including a partial

With Express 3.0: the path is relative from the caller who includes the file, not from the views directory set with app.set(“views”, “path/to/views”). EJS v1 includesEJS v2 includes (Update: the newest syntax for ejs v3.0.1 is <%- include(‘myview.ejs’) %>)

How to store Node.js deployment settings/configuration files?

Much later, I found a pretty good Node.js module for managing configuration: nconf. A simple example: It also supports storing settings in Redis, writing configuration files, and has a fairly solid API, and is also backed by one of the more well-respected Node.js shops, Nodejitsu, as part of the Flatiron framework initiative, so it should be fairly future-proof. Check out nconf … Read more