npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

rpa-robot-js

v1.0.1

Published

目前仅限windows平台使用

Downloads

10

Readme

RPA

目前仅限windows平台使用

安装

npm install rpa-robot-js

demo1 鼠标移动

const { mouse, straightTo, Point, up, down, right, left } = require('rpa-robot-js')
async function test1() {
    mouse.config.mouseSpeed = 2000 // 鼠标移动速度
    await mouse.move(straightTo(new Point(100, 100)))
    mouse.config.mouseSpeed = 1000
    await mouse.move(down(800))
    mouse.config.mouseSpeed = 3000
    await mouse.move(right(800))
    mouse.config.mouseSpeed = 4000
    await mouse.move(up(800))
    mouse.config.mouseSpeed = 1000
    await mouse.move(left(800))
}

test1()

demo2 移动到指定颜色区域

const { pixelWithColor, RGBA, screen, sleep } = require('rpa-robot-js')
async function test2() {
    const arr = await screen.findAll(pixelWithColor(new RGBA(240, 74, 62, 255)))
    console.log('chenjing', arr)
    for (const item of arr) {
        await mouse.move(straightTo(item))
        await sleep(50)
    }
    const width = await screen.width()
    const height = await screen.height()
    console.log(width, height)
}
test2()

demo3 读取/写入 剪贴板

const { clipboard } = require('rpa-robot-js')
async function test3() {
    const getContent = await clipboard.getContent()
    console.log('读取剪贴板内容:', getContent)
    await clipboard.setContent('将这段信息存到剪贴板')
    
    const getContent2 = await clipboard.getContent()
    console.log('读取剪贴板--代码写入內容:', getContent2)
}
test3()

demo4 键盘输入

const { keyboard, Key } = require('rpa-robot-js')
async function test4() {
    await keyboard.pressKey(Key.A)
    await keyboard.releaseKey(Key.A)
    
    await keyboard.type('HELLO WORLD')

    await keyboard.pressKey(Key.LeftControl, Key.V)
    await keyboard.releaseKey(Key.LeftControl, Key.V)
}
test4()