Skip to content

l4503071/capture

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sunshine_bit@capture

截取指定 url 的屏幕信息,可以指定屏幕的宽和高.

安装

npm i @sunshine_bit/capture

参数

  • options [object]
    • url default: 'https://github.com/l4503071'(需要使用encodeURIComponent转义)
    • width default: 375,
    • height default: 667,
    • deviceScaleFactor default: 2,
    • fileName default: 'capture.png',
    • encoding default: 'binary',
      • 'base64': base64[string]
      • 'binary': 二进制文件[buffer]

TODO: 其他参数覆盖,参考 (./devices.js)

事例

const capture = require('@sunshine_bit/capture');
capture.capture({
  encoding: 'base64',
}).then((data)=>{
  console.log(data)
});

About

capture the screen with width and height.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published