This is a basic question, but I'm struggling to find the answer. I am trying to import a js file (located here: http://eloquentjavascript.net/code/ancestry.js) into my Cloud9 Nodejs IDE, but I don't know how to do it.
I have successfully imported the file into my library. However, I am unclear on what I am to do with the code added at the bottom of the file:
// `require(./path/to/ancestry.js)` will get you the array.
if (typeof module != "undefined" && module.exports)
module.exports = ANCESTRY_FILE;
I tried adding it to the server.js file with no success.
Thanks in advance, josh
var ancestry = require('./ancestry');