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 🙏

© 2026 – Pkg Stats / Ryan Hefner

keyboard-mouse-share

v1.0.4

Published

Share keyboard and mouse between Mac and Windows

Readme

Keyboard & Mouse Share (KMS) - Node.js Version

Share your keyboard and mouse between Mac and Windows seamlessly over your local network.

Features

  • 🖱️ Share Keyboard & Mouse - Control multiple machines with one set of peripherals
  • 🔄 Cross-Platform - Works between Mac and Windows
  • ⌨️ Hotkey Switching - Toggle control with Ctrl+= (configurable)
  • 🌐 Network-Based - Works over local network (WiFi/Ethernet)
  • 🎯 Simple CLI - Easy to configure and use
  • High Performance - Built on Node.js for efficient async I/O

Installation

From npm (coming soon)

npm install -g keyboard-mouse-share

From Source

cd kms-node
npm install
npm link

Requirements

  • Node.js 16.0.0 or higher (tested on v16, v18, v20, v22)
  • Administrator/root privileges (required for keyboard/mouse control)
  • Both machines must be on the same network

Platform-Specific Setup

Windows:

  • Run terminal as Administrator
  • No additional dependencies needed (nut.js provides pre-built binaries)

Mac:

  • Grant Accessibility permissions:
    • System Preferences → Security & Privacy → Privacy → Accessibility
    • Add Terminal (or your terminal app)
  • No build tools required (nut.js provides pre-built binaries)

Linux:

  • Install X11 dependencies:
    sudo apt-get install libxtst-dev libpng++-dev

Quick Start

Setup Master Machine (Server)

The master machine is the one whose keyboard and mouse you want to share.

# Initialize as server
kms init --mode server --port 5555

# Start the server
kms start

Setup Client Machine

The client machine will receive and reproduce the keyboard/mouse events.

# Initialize as client (replace with your server's IP)
kms init --mode client --host 192.168.1.10 --port 5555

# Start the client
kms start

Usage

Commands

# Initialize configuration
kms init --mode [server|client] --host <ip> --port <port>

# Start KMS service
kms start

# Show current configuration
kms status

# Change hotkey combination
kms set-hotkey "CTRL + SHIFT + K"

# Reset configuration
kms reset

# Show version
kms --version

# Show help
kms --help

Hotkey Control

By default, press Ctrl+= on the server to toggle between:

  • Enabled: Server's input is captured and sent to client
  • Disabled: Server operates normally (no sharing)

You can customize the hotkey:

kms set-hotkey "CTRL + SHIFT + S"

Note: Use = instead of + in the hotkey combination (keyboard limitation).

Network Setup

  1. Find your server's IP address:

    • Windows: ipconfig
    • Mac/Linux: ifconfig or ip addr
  2. Ensure port is open:

    • Default port: 5555
    • Configure firewall to allow incoming connections on this port

Architecture

┌─────────────────┐         Network          ┌─────────────────┐
│  Master (Server)│    ───────────────>      │  Client         │
│                 │                          │                 │
│  Captures input │   Sends events (JSON)    │  Reproduces     │
│  + Hotkey       │   over TCP socket        │  input events   │
└─────────────────┘                          └─────────────────┘

Configuration

Configuration is stored in ~/.kms/config.json:

{
  "mode": "server",
  "port": 5555,
  "host": null,
  "hotkey": "CTRL + =",
  "logLevel": "INFO"
}

Troubleshooting

Installation Issues

nut.js installation fails:

  • Ensure you're using Node.js 16.0.0 or higher
  • On Linux, install X11 dependencies: sudo apt-get install libxtst-dev libpng++-dev
  • nut.js provides pre-built binaries for most platforms (no compilation needed)

Connection Issues

  • Ensure both machines are on the same network
  • Check firewall settings (port 5555 must be open)
  • Verify server IP address is correct

Permission Errors

  • Windows: Run as Administrator
  • Mac: Grant Accessibility permissions in System Preferences
  • Linux: Run with sudo

Hotkey Not Working

  • Requires administrator/root privileges
  • Try a different key combination
  • Check if another application is using the same hotkey

Performance

Node.js version benefits:

  • ✅ Asynchronous I/O for better network performance
  • ✅ Non-blocking event loop
  • ✅ Lower latency compared to Python (typically < 5ms)
  • ✅ Efficient memory usage
  • ✅ Pre-built binaries (no compilation needed with nut.js)

Limitations

  • No encryption in v0.1 (use on trusted networks only)
  • Single client connection at a time
  • Input capture uses polling (60fps) - future versions will use native hooks

Roadmap

  • [ ] Native event hooks (replace polling)
  • [ ] Multi-client support
  • [ ] Clipboard sharing
  • [ ] Encryption for secure transmission
  • [ ] GUI interface
  • [ ] Auto-discovery of devices on network
  • [ ] File transfer support
  • [ ] Pre-built binaries (no compilation needed)

Comparison: Node.js vs Python

| Feature | Node.js | Python | |---------|---------|--------| | Network I/O | Faster (async native) | Good | | Installation | Pre-built binaries (nut.js) | No compilation | | Performance | ~5-10ms latency | ~10-15ms latency | | Memory | Lower | Higher | | Maturity | nut.js modern & maintained | pynput very stable | | Node.js Support | v16-v22+ ✅ | N/A |

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

MIT License - see LICENSE file for details

Acknowledgments

Built with: