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

screencapturekit

v1.0.22

Published

A nodejs wrapper over a swift CLI program which is a wrapper over ScreenCaptureKit module with HDR and microphone support

Readme

ScreenCaptureKit Node.js

A Node.js wrapper for Apple's ScreenCaptureKit module. This package allows screen recording on macOS with optimal performance using Apple's native APIs.

Features

  • High-performance screen recording
  • HDR (High Dynamic Range) support for macOS 13+ (Ventura)
  • System audio capture
  • Microphone audio capture (macOS 15+)
  • Direct-to-file recording (simplified API for macOS 15+)
  • Post-processing capabilities for audio tracks with FFmpeg
  • Cropping support (capture specific screen areas)
  • Multiple options control (FPS, cursor display, click highlighting)
  • Support for various video codecs (H264, HEVC, ProRes)
  • Listing available screens and audio devices

Requirements

  • macOS 10.13 (High Sierra) or newer
  • Node.js 14 or newer
  • FFmpeg (for post-processing audio tracks)

FFmpeg Installation

FFmpeg is required for post-processing audio tracks. Here's how to install it on different systems:

macOS

Using Homebrew:

brew install ffmpeg

Linux (Debian/Ubuntu)

Using apt package manager:

sudo apt update && sudo apt install ffmpeg

Windows

You have several options:

  1. Using Chocolatey (recommended if you have Chocolatey installed):
choco install ffmpeg
  1. Using the MSI Installer (easiest method):

    • Download the FFmpeg Installer from GitHub
    • Run the MSI file and follow the installation wizard
    • FFmpeg will be automatically added to your system PATH
  2. Manual Installation:

    • Download FFmpeg from ffmpeg.org
    • Extract the archive
    • Add FFmpeg to your system PATH manually

To verify the installation on any system, open a terminal/command prompt and run:

ffmpeg -version

Installation

npm install screencapturekit

Usage

Simple Screen Recording

import createScreenRecorder from 'screencapturekit';

const recorder = createScreenRecorder();

// Start recording
await recorder.startRecording();

// Wait for desired duration...
setTimeout(async () => {
  // Stop recording
  const videoPath = await recorder.stopRecording();
  console.log('Video recorded at:', videoPath);
}, 5000);

Recording with Advanced Options

import createScreenRecorder from 'screencapturekit';

const recorder = createScreenRecorder();

// Start recording with options
await recorder.startRecording({
  fps: 60,
  showCursor: true,
  highlightClicks: true,
  screenId: 0,
  videoCodec: 'h264',
  enableHDR: true, // Enable HDR recording (macOS 13+)
  microphoneDeviceId: 'device-id', // Enable microphone capture (macOS 15+)
  recordToFile: true, // Use direct recording API (macOS 15+)
  cropArea: {
    x: 0,
    y: 0,
    width: 1920,
    height: 1080
  }
});

// Wait...

// Stop recording
const videoPath = await recorder.stopRecording();

List Available Screens

import { screens } from 'screencapturekit';

const availableScreens = await screens();
console.log(availableScreens);

List Audio Devices

import { audioDevices, microphoneDevices } from 'screencapturekit';

// System audio devices
const systemAudio = await audioDevices();
console.log(systemAudio);

// Microphone devices
const mics = await microphoneDevices();
console.log(mics);

Check Support for Features

import { supportsHDRCapture, supportsDirectRecordingAPI, supportsMicrophoneCapture } from 'screencapturekit';

if (supportsHDRCapture) {
  console.log('Your system supports HDR capture');
}

if (supportsDirectRecordingAPI) {
  console.log('Your system supports direct-to-file recording');
}

if (supportsMicrophoneCapture) {
  console.log('Your system supports microphone capture');
}

Recording Options

| Option | Type | Default | Description | |--------|------|------------|-------------| | fps | number | 30 | Frames per second | | cropArea | object | undefined | Cropping area {x, y, width, height} | | showCursor | boolean | true | Display cursor in recording | | highlightClicks | boolean | false | Highlight mouse clicks | | screenId | number | 0 | ID of screen to capture | | audioDeviceId | number | undefined | System audio device ID | | microphoneDeviceId | string | undefined | Microphone device ID (macOS 15+) | | videoCodec | string | 'h264' | Video codec ('h264', 'hevc', 'proRes422', 'proRes4444') | | enableHDR | boolean | false | Enable HDR recording (macOS 13+) | | recordToFile | boolean | false | Use direct recording API (macOS 15+) | | audioOnly | boolean | false | Record audio only, will convert to mp3 after recording |

Post-processing

When both system audio and microphone are recorded, the library uses FFmpeg to merge these tracks into a single video file. This happens automatically in the stopRecording() method. Make sure you have FFmpeg installed on your system.

Development

npm install
npm run build

Tests

npm test

License

MIT