screenshot-native

1.0.4 • Public • Published

screenshot-native

Screenshots for NodeJS, blazingly fast and easy to use

Installing

yarn add sceenshot-native
or
npm i screenshot-native

Usage

import { screenshot, getRegion, screenSize, encode, toURL } from 'screenshot-native'
or
const { screenshot, getRegion, screenSize, encode, toURL } = require('screenshot-native')

Get a region of the screen

let image = getRegion(0,0,100,100) //Will return raw screenshot data
let encoded = encode(image,'png')
let base64 = toURL(encoded); // you can use this in browser
fs.writeFileSync('test.png',encoded) //or write to local file

Get full screenshot

let image = screenshot() //Will return raw screenshot data
let encoded = encode(image,'png')
let base64 = toURL(encoded); // you can use this in browser
fs.writeFileSync('test.png',encoded) //or write to local file

Package Sidebar

Install

npm i screenshot-native

Weekly Downloads

4

Version

1.0.4

License

ISC

Unpacked Size

15.5 kB

Total Files

6

Last publish

Collaborators

  • dimulcu