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 🙏

© 2025 – Pkg Stats / Ryan Hefner

node-stylus

v1.0.3

Published

A cross-platform library for virtual stylus input on Windows and macOS

Downloads

9

Readme

node-stylus

Windows와 macOS에서 가상 스타일러스 입력을 시뮬레이션하기 위한 Node.js 네이티브 애드온입니다. 이 라이브러리를 사용하면 압력 감지 기능이 있는 펜/스타일러스 입력 이벤트를 프로그래밍 방식으로 시뮬레이션할 수 있습니다.

특징

  • Windows와 macOS 크로스 플랫폼 지원
  • 사용자 정의 좌표로 펜/스타일러스 입력 이벤트 시뮬레이션
  • 압력 감도 지원 (0.0 - 1.0)
  • Electron 애플리케이션과 쉽게 통합

설치

npm install node-stylus

사용 방법

const nodeStylus = require('node-stylus');

// 펜 디바이스 초기화 (Windows에서 필수)
const initialized = nodeStylus.initPenDevice();
console.log(`펜 디바이스 초기화 상태: ${initialized}`);

// 좌표와 압력을 통한 펜 이벤트 전송
// 매개변수: x, y, pressure (0.0에서 1.0 사이)
nodeStylus.sendPenEvent(100, 200, 0.5);

Electron 애플리케이션에서 사용하기

const { app, BrowserWindow } = require('electron');
const nodeStylus = require('node-stylus');
const path = require('path');

app.whenReady().then(() => {
  // 가능한 빨리 펜 디바이스 초기화
  nodeStylus.initPenDevice();
  
  const mainWindow = new BrowserWindow({
    width: 800,
    height: 600,
    webPreferences: {
      preload: path.join(__dirname, 'preload.js')
    }
  });
  
  // 이제 nodeStylus.sendPenEvent()를 사용하여 펜 입력을 시뮬레이션할 수 있습니다
});

API

nodeStylus.initPenDevice()

가상 펜 디바이스를 초기화합니다. 펜 이벤트를 보내기 전에 Windows에서는 반드시 필요합니다.

반환값: boolean - 초기화가 성공적이면 true.

nodeStylus.sendPenEvent(x, y, pressure)

지정된 좌표에 주어진 압력으로 가상 펜 이벤트를 전송합니다.

매개변수:

  • x (number): 펜 이벤트의 X 좌표
  • y (number): 펜 이벤트의 Y 좌표
  • pressure (number, 옵션): 0.0에서 1.0 사이의 압력 값. 기본값은 1.0.

반환값: boolean - 이벤트가 성공적으로 전송되었으면 true.

플랫폼별 세부 사항

Windows

Windows 포인터 API를 사용하여 펜 입력 이벤트를 시뮬레이션합니다. Windows 8 이상 필요.

macOS

CoreGraphics API를 사용하여 태블릿 포인터 이벤트를 시뮬레이션합니다.

라이센스

MIT