📜  如何使用 JavaScript 代码示例在浏览器中截屏

📅  最后修改于: 2022-03-11 15:02:21.001000             🧑  作者: Mango

代码示例2
const url2png = require('url2png')('API_KEY', 'PRIVATE_KEY');
const fs = require('fs');

app.get('/screenshot', (req, res) => {
    url2png.readURL(req.query.url, {}).pipe(fs.createWriteStream('screenshot.png'));
    res.json({success: true})
});