Skip to content
This repository has been archived by the owner on Sep 30, 2023. It is now read-only.
/ rubick-base Public archive

desktop automation, screen capture, input listen/simulation, asar compress, color picker for nodejs and electron based on rust. 基于 Rust / WASM 提供截图、取色、键鼠事件监听模拟、压缩解压、图像处理、获取已安装应用等跨平台功能的现代异步 Nodejs 模块,占用空间小, 安装便捷, 使用简单, 高性能, 资源占用极小, 可取代 iohook 和 robotjs

License

Notifications You must be signed in to change notification settings

rubickCenter/rubick-base

Folders and files

NameName
Last commit message
Last commit date

Latest commit

354f7ff · Sep 11, 2021
Sep 11, 2021
Sep 11, 2021
Sep 11, 2021
Sep 11, 2021
Sep 11, 2021
Sep 11, 2021
Sep 11, 2021
Sep 11, 2021
Sep 9, 2021
Sep 11, 2021
Sep 11, 2021
Sep 11, 2021
Sep 11, 2021
Sep 11, 2021
Sep 11, 2021

Repository files navigation

rubickbase

基于 Rust 提供原生能力 API 的现代 Nodejs 模块,大小 2.2M,使用简单,可取代 iohook 和 robotjs

Built-in APIs

  • 键鼠事件监听钩子
  • 截图
  • 图片取色
  • 获取鼠标位置
  • 获取鼠标像素颜色
  • 事件订阅模式
  • 注册快捷键(装饰器风格)

Install

npm install --save rubickbase

Getting start

// cjs
const { newRubickBase } = require('rubickbase')
// esm
import { newRubickBase } from 'rubickbase'

const rubickBase = newRubickBase()

async function main() {
	// start rubickbase
	await server.start()
	const api = server.getAPI()
	// screen capture
	await api.screenCapture('./capture.png')
	// cursor Position
	let task = setInterval(async () => {
		console.log(await api.getCursorPositionPixelColor())
	}, 1000)
	// close rubickbase
	setTimeout(async () => {
		await server.close()
		clearInterval(task)
	}, 10000)
}

main()

Contribute

npm install -g pnpm

Action Command
Install · pnpm i
Build · pnpm build
Commit · pnpm commit
Release · pnpm release

TODO

  • 去除 jimp 依赖,精简安装大小

About

desktop automation, screen capture, input listen/simulation, asar compress, color picker for nodejs and electron based on rust. 基于 Rust / WASM 提供截图、取色、键鼠事件监听模拟、压缩解压、图像处理、获取已安装应用等跨平台功能的现代异步 Nodejs 模块,占用空间小, 安装便捷, 使用简单, 高性能, 资源占用极小, 可取代 iohook 和 robotjs

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published