I'm wondering if it's possible to pass the contents of fs.readfile out of the scope of the readfile method and store it in a variable similar to.
var a;
function b () {
    var c = "from scope of b";
    a = c;
}
b();
Then I can console.log(a); or pass it to another variable.
My question:
Is there a way to do this with fs.readFile so that the contents (data) get passed to the global variable global_data.
var fs = require("fs");
var global_data;
fs.readFile("example.txt", "UTF8", function(err, data) {
    if (err) { throw err };
    global_data = data;
});
console.log(global_data);  // undefined
 
     
    