This is a follow-up to my previous question
Suppose I've some javascript
code, which runs fine on client (in a browser). This code makes a lot of XHR
calls using the browser API.
Now I would like to run this code in node.js
. Does node.js
provide the XHR
API as in browser ?
fs.readFile
. – Embrocatefs.readFile()
has nothing to do with XHR. If you want an XHR shim for node, there are several modules on npm that do that. However you should be aware that the entire API may not be the same, for example there would be no synchronous API because node only has async network I/O. – Fenellafs.readFile()
. You don't need http request to get those files. – Embrocate