Install to your project:
npm install @guidepup/recordUse record to select the recorder for the current operating system:
import { record } from "@guidepup/record";
const stopRecording = record("./recordings/screenRecording.mp4");
// ... perform some commands.
await stopRecording();On Linux, automatic selection uses the X11 recorder and requires the DISPLAY
environment variable. Wayland-only sessions are not supported.
Start a screen recording on Windows:
import { windowsRecord } from "@guidepup/record";
(async () => {
// Start the screen recording passing the location to save the recording.
const stopRecording = windowsRecord("./recordings/screenRecording.mp4");
// ... perform some commands.
// Stop the screen recording.
await stopRecording();
})();Start a screen recording on MacOS.
import { macOSRecord } from "@guidepup/record";
(async () => {
// Start the screen recording passing the location to save the recording.
const stopRecording = macOSRecord("./recordings/screenRecording.mov");
// ... perform some commands.
// Stop the screen recording.
await stopRecording();
})();Start a screen recording on Linux using an X11 display. The DISPLAY
environment variable must identify the display. Wayland-only sessions are not
supported by this recorder.
import { linuxRecord } from "@guidepup/record";
(async () => {
// Start the screen recording passing the location to save the recording.
const stopRecording = linuxRecord("./recordings/screenRecording.mp4");
// ... perform some commands.
// Stop the screen recording.
await stopRecording();
})();