You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
var webshot = require('webshot');
var fs = require('fs');
webshot('google.com', function(err, renderStream) {
var file = fs.createWriteStream('google.png', {encoding: 'binary'});
renderStream.on('data', function(data) {
file.write(data.toString('binary'), 'binary');
});
});
The stream instance is returned asynchronously. Why is this? Should the code not look like this?
var webshot = require('webshot');
var fs = require('fs');
var file = fs.createWriteStream('google.png', {encoding: 'binary'});
var renderStream = webshot('google.com');
renderStream.pipe(file);
The text was updated successfully, but these errors were encountered:
In the documentation, this is declared:
The stream instance is returned asynchronously. Why is this? Should the code not look like this?
The text was updated successfully, but these errors were encountered: