why? Why not just use casperjs or something and use the built-in method?
It's literally 3 lines of code. Or even a one-liner if you really want.
require('casper')
.create()
.start('https://rms.sexy')
.then(function() {
this.capture('test.png');
}).run();