require is meant for loading your modules; the recommended way to load files (including the JSON ones) is through Node's filesystem module.
You could do something like this:
// Declare your variables
var fs = require('fs');
var menObject;
// Read the file, and pass it to your callback
fs.readFile('./men.json, handleJSONFile);
// Handle the data
var handleJSONFile = function (err, data) {
if (err) {
throw err;
}
menObject = JSON.parse(data);
}
Sai Kishore Komanduri
Engineering an eGovernance Product | Hashnode Alumnus | I love pixel art