
Security News
/Research
Wallet-Draining npm Package Impersonates Nodemailer to Hijack Crypto Transactions
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
@getexcited/chompers
Advanced tools
High-performance native Node.js addon for Windows screen recording and window enumeration
High-performance native Node.js addon for Windows screen recording and window enumeration, built with Rust and napi-rs.
npm install @getexcited/chompers
# or
yarn add @getexcited/chompers
import {
Recorder,
RecorderConfig,
AudioSource,
VideoEncoderType,
} from "@getexcited/chompers";
// Basic recording configuration
const config: RecorderConfig = {
fpsNumerator: 30,
fpsDenominator: 1,
outputWidth: 1920,
outputHeight: 1080,
captureAudio: true,
captureMicrophone: false,
audioSource: AudioSource.Desktop,
videoEncoderType: VideoEncoderType.H264,
captureCursor: true,
outputPath: "recording.mp4",
debugMode: false,
enableReplayBuffer: false,
};
// Create recorder and target a specific process
const recorder = new Recorder(config).withProcessName("notepad");
// Start recording
recorder.startRecording();
// Record for 10 seconds
setTimeout(() => {
recorder.stopRecording();
console.log("Recording completed!");
}, 10000);
import {
Recorder,
RecorderConfigBuilder,
AudioSource,
} from "@getexcited/chompers";
// Create recorder with replay buffer
const config = new RecorderConfigBuilder()
.fps(30, 1)
.outputDimensions(1920, 1080)
.captureAudio(true)
.audioSource(AudioSource.Desktop)
.enableReplayBuffer(true)
.replayBufferSeconds(30) // Keep last 30 seconds
.outputPath("main_recording.mp4")
.build();
const recorder = new Recorder(config).withProcessName("game.exe");
// Start recording with buffer
recorder.startRecording();
// Save replay when something interesting happens
recorder.saveReplay("highlight.mp4");
// Continue recording or stop
recorder.stopRecording();
import { getAllWindows } from "@getexcited/chompers";
// Get all windows with detailed information
const windows = getAllWindows();
windows.forEach((window) => {
console.log(`Title: ${window.title}`);
console.log(`Process: ${window.executable}`);
console.log(`PID: ${window.pid}`);
console.log(`Focused: ${window.focused}`);
console.log(
`Monitor: ${window.monitorDimensions.width}x${window.monitorDimensions.height}`
);
console.log("---");
});
Recorder
Main recording class for capturing screen content.
class Recorder {
constructor(config: RecorderConfig);
withProcessName(processName: string): Recorder;
startRecording(): void;
stopRecording(): void;
saveReplay(path: string): void;
}
RecorderConfigBuilder
Fluent builder for creating recorder configurations.
class RecorderConfigBuilder {
fps(numerator: number, denominator: number): this;
inputDimensions(width: number, height: number): this;
outputDimensions(width: number, height: number): this;
captureAudio(capture: boolean): this;
captureMicrophone(capture: boolean): this;
audioSource(source: AudioSource): this;
microphoneVolume(volume: number): this;
systemVolume(volume: number): this;
microphoneDevice(deviceName?: string): this;
videoEncoder(encoderType: VideoEncoderType): this;
videoEncoderName(name: string): this;
captureCursor(capture: boolean): this;
outputPath(path: string): this;
debugMode(debug: boolean): this;
enableReplayBuffer(enable: boolean): this;
replayBufferSeconds(seconds: number): this;
build(): RecorderConfig;
}
RecorderConfig
interface RecorderConfig {
fpsNumerator: number; // Frame rate numerator
fpsDenominator: number; // Frame rate denominator
inputWidth?: number; // Input resolution width (auto-detected if not set)
inputHeight?: number; // Input resolution height (auto-detected if not set)
outputWidth: number; // Output resolution width
outputHeight: number; // Output resolution height
captureAudio: boolean; // Enable system audio capture
captureMicrophone: boolean; // Enable microphone capture
audioSource: AudioSource; // Desktop or ActiveWindow
microphoneVolume?: number; // Microphone volume (0.0-1.0)
systemVolume?: number; // System audio volume (0.0-1.0)
microphoneDevice?: string; // Specific microphone device name
videoEncoderType?: VideoEncoderType; // H264 or HEVC
videoEncoderName?: string; // Specific encoder name
captureCursor: boolean; // Include cursor in recording
outputPath: string; // Output file path
debugMode: boolean; // Enable debug logging
enableReplayBuffer: boolean; // Enable replay buffer feature
replayBufferSeconds?: number; // Replay buffer duration in seconds
}
WindowInfo
interface WindowInfo {
className: string; // Window class name
executable: string; // Executable name
title: string; // Window title
pid: number; // Process ID
productName?: string; // Product name from executable
hwnd: number; // Window handle
fullExe: string; // Full executable path
monitorDimensions: MonitorDimensions; // Monitor information
intersectsMultiple: boolean; // Spans multiple monitors
focused: boolean; // Currently focused window
arguments: Array<string>; // Process arguments
}
AudioSource
enum AudioSource {
Desktop = "Desktop", // Capture all system audio
ActiveWindow = "ActiveWindow", // Capture audio from target window only
}
VideoEncoderType
enum VideoEncoderType {
H264 = "H264", // H.264/AVC encoding
HEVC = "HEVC", // H.265/HEVC encoding
}
// Enumerate available audio input devices
function enumerateAudioInputDevices(): AudioInputDevice[];
// Get preferred video encoder by type
function getPreferredVideoEncoderByType(
encoderType: VideoEncoderType
): VideoEncoder | null;
// Enumerate available video encoders
function enumerateVideoEncoders(): VideoEncoder[];
// Get all windows with detailed information
function getAllWindows(): WindowInfo[];
The examples/
directory contains comprehensive TypeScript examples:
basic_recording.ts
- Basic screen recording setupreplay_buffer.ts
- Replay buffer functionalityselect_audio_device.ts
- Audio device enumeration and selectionselect_video_encoder.ts
- Video encoder enumeration and selectionRun examples with:
# Show available examples
yarn examples
# Run specific examples
yarn example:basic
yarn example:replay
yarn example:audio
yarn example:encoder
The library automatically uses hardware-accelerated encoding when available:
Recording fails to start
No audio captured
Poor performance
No video encoders found
Enable debug logging for troubleshooting:
const config: RecorderConfig = {
// ... other options
debugMode: true,
};
# Clone the repository
git clone https://github.com/GetExcitedApp/chompers.git
cd chompers
# Install dependencies
yarn install
# Build the native addon
yarn build
# Run tests
yarn test
Contributions are welcome! Please read our contributing guidelines and submit pull requests to the main repository.
This project is licensed under the GPL-3.0-only License. See the LICENSE file for details.
Note: This library is Windows-only and requires Windows 10 or later. For cross-platform solutions, consider other recording libraries.
FAQs
High-performance native Node.js addon for Windows screen recording and window enumeration
We found that @getexcited/chompers demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.