I'm using node.js to build a webapp and I need to use synchronous request for getting a file.
I know how to get the file locally:
var fs = require('fs');
var myFile = fs.readFileSync('myFile.html', 'utf8');
but I want to read this file from the web like this:
var fs = require('fs');
var myFile = fs.readFileFromWebSync('http://www.theweb.com/myFile.html', 'utf8');
How do I read a file synchroniously from web?
I need it to be synchronious because this is part of a single build process and not part of a web server.