I have a node.js server running on a VPS and I want to use a js script that is served from another server, something like:
http://example.com/api/js <
http://example.com/api/js
exec('wget http://example.com/api/js', function(stdout) { }); should do the trick. If you need advanced control, use http module
exec('wget http://example.com/api/js', function(stdout) { });
http
http://docs.nodejitsu.com/articles/HTTP/clients/how-to-create-a-HTTP-request