百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
N

node-screenshots

> DevOps
开源

不依赖零。一个原生的 nodejs 屏幕截图库,适用于 Mac、Windows 和 Linux。

382 stars0 点赞1 次浏览
访问官网GitHub

工具介绍

不依赖零。一个原生的 nodejs 屏幕截图库,适用于 Mac、Windows 和 Linux。

node-screenshots

node-screenshots is a native node.js screenshot library based on XCap, It supports Mac, Windows, and Linux systems without any dependencies. node-screenshots supports screenshot and video recording (to be implemented).

English | 简体中文

Support Matrix

Operating System

Operating System node16 node18 node20
Windows x64 ✓ ✓ ✓
Windows x32 ✓ ✓ ✓
Windows arm64 ✓ ✓ ✓
macOS x64 ✓ ✓ ✓
macOS arm64 ✓ ✓ ✓
Linux x64 gnu ✓ ✓ ✓
Linux x64 musl ✓ ✓ ✓
Linux arm64 gnu ✓ ✓ ✓
Linux loongarch64 ✓ ✓ ✓

Example

Monitor

…

Window

…

API

Full typeScript type definition: index.d.ts

Monitor

  • static all(): Array: Get all monitor
  • static fromPoint(x: number, y: number): Monitor | null: Get a monitor from the specified coordinates
  • captureImageSync(): Image: Synchronously capture image
  • captureImage(): Promise: Asynchronously capture image

Window

  • static all(): Array: Get all window
  • captureImageSync(): Image: Synchronously capture image
  • captureImage(): Promise: Asynchronously capture image

Image

  • cropSync(x: number, y: number, width: number, height: number): Image: Synchronously crop image
  • crop(x: number, y: number, width: number, height: number): Promise: Asynchronously crop image
  • toPngSync(copyOutputData?: boolean | undefined | null): Buffer:Synchronously Convert to png
  • toPng(copyOutputData?: boolean | undefined | null): Promise: Asynchronously Convert to png
  • toJpegSync(copyOutputData?: boolean | undefined | null): Buffer: Synchronously Convert to jpeg
  • toJpeg(copyOutputData?: boolean | undefined | null): Promise: Asynchronously Convert to jpeg
  • toBmpSync(copyOutputData?: boolean | undefined | null): Buffer: Synchronously Convert to bmp
  • toBmp(copyOutputData?: boolean | undefined | null): Promise: Asynchronously Convert to bmp
  • toRawSync(copyOutputData?: boolean | undefined | null): Buffer: Synchronously Convert to raw(RGBA data)
  • toRaw(copyOutputData?: boolean | undefined | null): Promise: Asynchronously Convert to raw(RGBA data)

copyOutputData: pass related parameters in electron, otherwise electron will crash, nodejs does not pass or passes false, performance will be better, for more information refer to https://github.com/napi-rs/napi-rs/issues/1346

Linux System Requirements

On Linux, you need to install libxcb, libxrandr, and dbus.

Debian / Ubuntu:

bash
apt-get install libxcb1 libxrandr2 libdbus-1-3

Alpine:

bash
apk add libxcb libxrandr dbus

Related Repositories

  • xcap - XCap is a cross-platform screen capture library written in Rust

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Rustlinuxmacosnativenodejs

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类DevOps
定价开源

> 相关工具

D
Docker
容器化平台,标准化应用交付
G
GitHub Actions
GitHub 原生 CI/CD 工作流
N
Nginx
高性能 Web 服务器与反向代理