Accessing circular JSON structure

Solution 1:

Already answered here

JSON.stringify(moduleDef.exports, function( key, value) {
  if(key == 'moduleName') { 
    return value.id;
  } else {
    return value;
  };
})