JSPM

screenshot-native

1.0.4
    • ESM via JSPM
    • ES Module Entrypoint
    • Export Map
    • Keywords
    • License
    • Repository URL
    • TypeScript Types
    • README
    • Created
    • Published
    • Downloads 1
    • Score
      100M100P100Q25517F
    • License ISC

    Package Exports

    • screenshot-native

    This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (screenshot-native) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    Readme

    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