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

custom-mac-screen-share

v1.0.2

Published

ScreenCaptureKit bindings for Node.js with enhanced security features

Readme

custom-mac-screen-share

npm

Bindings for macOS ScreenCaptureKit with enhanced security features.

Based on @indutny/mac-screen-share with security improvements.

Security Enhancements

This fork includes critical security fixes:

  • Input validation - Width, height, and frameRate are validated to prevent DoS attacks
  • Integer overflow protection - Buffer size calculations are checked for overflow
  • Graceful error handling - Invalid frames are skipped instead of crashing the process
  • Deadlock prevention - 30-second timeout on frame processing to prevent hangs
  • Thread safety - Improved synchronization for buffer access

Installation

npm install custom-mac-screen-share

Requirements: macOS 15.0 or later

Usage

import { Stream } from 'custom-mac-screen-share';

const stream = new Stream({
  width: 1024, // Valid range: 1-7680
  height: 768, // Valid range: 1-4320
  frameRate: 10, // Valid range: 1-120

  onStart() {},
  onStop(error) {},
  onFrame(frame, width, height) {
    // Frame is in Nv12 encoding (YUV 4:2:0 format)
    // frame: Buffer containing the raw video data
    // width, height: actual frame dimensions
  },
});

// Later
stream.stop();

API Reference

new Stream(options)

Creates a new screen capture stream and opens the native macOS picker.

Options:

  • width (number, required): Output width in pixels (1-7680)
  • height (number, required): Output height in pixels (1-4320)
  • frameRate (number, required): Target frame rate (1-120 fps)
  • onStart (function, required): Called when capture starts after user selection
  • onStop (function, required): Called when capture stops, receives optional error
  • onFrame (function, required): Called for each captured frame with (buffer, width, height)

Stream.stop()

Stops the screen capture stream.

isSupported

Boolean indicating whether ScreenCaptureKit is available on the current system.

LICENSE

This software is licensed under the MIT License.