screenshot-desktop | π» Capture a screenshot of your local machine | Image Editing library
kandi X-RAY | screenshot-desktop Summary
kandi X-RAY | screenshot-desktop Summary
Capture a screenshot of your local machine
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Creates a new D3 snapshot .
screenshot-desktop Key Features
screenshot-desktop Examples and Code Snippets
const screenshot = require('screenshot-desktop')
const nodemailer = require('nodemailer')
const schedule = require('node-schedule')
const fs = require('fs')//nodejs ζδ»Άζδ½ηε
$ npm install --save screenshot-desktop
const screenshot = require('screenshot-desktop')
screenshot({ filename: 'shot.jpg' }).then((imgPath) => {
// imgPath: absolute path to screenshot
// created in curren
Community Discussions
Trending Discussions on screenshot-desktop
QUESTION
i am making a script that will take a picture of my desktop (for server disk stuff) but it doesn't take the picture. But it will when i create another script and run that.
...ANSWER
Answered 2021-Mar-18 at 18:47Whenever a function writes/reads a file (or query database) it is most likely asynchronous which means you need to wait for it to write/read the file then continue.
As you can see in the docs https://www.npmjs.com/package/screenshot-desktop#usage
screenshot()
returns a Promise so you have 2 options.
First, call Bot.sendFile
in the then
function like so
QUESTION
screenshot-desktop is a promise based npm API which takes the desktop screenshot and stores it when called.
However, I need to call the function thrice and set a delay of 5 secs between each call. Since this is a promise API, their execution takes place instantly. Can I create a delay between my calls?
...ANSWER
Answered 2020-Jun-09 at 19:49I advise you to use promises in the following way:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install screenshot-desktop
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page