Skip to content

Commit 0fc4950

Browse files
My node file - init commit
1 parent d56df04 commit 0fc4950

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

index.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
var request = require('request'),
2+
fs = require('fs'),
3+
myBody = null,
4+
myHost = null,
5+
myPrefix = '- ';
6+
7+
request('http://cssinliner.dev/examples/example.php',
8+
function(err, response, body) {
9+
if(err) return console.log(err);
10+
11+
myBody = body;
12+
console.log(myPrefix + 'Its works');
13+
14+
fs.writeFile('my-result.html', myBody,
15+
function(err) {
16+
if(err) {
17+
return console.log(err);
18+
}
19+
20+
console.log(myPrefix + 'The file was saved!');
21+
}
22+
);
23+
}
24+
);

0 commit comments

Comments
 (0)