UNPKG

screenshot-desktop

Version:
14 lines (12 loc) 251 B
const screenshot = require('./') const fs = require('fs') screenshot().then((img) => { fs.writeFile('out.jpg', img, function (err) { if (err) { throw err } console.log('written to out.jpg') }) }).catch((err) => { throw err })