You don't need all of this, in node.js: require("./book") will try loading the file `./book`, then `./book.js`, then `./book.json` (http://nodejs.org/api/modules.html#modules_file_modules)

So this code could be cleaner (only 3 lines)