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

@recappi/sdk

v1.2.0

Published

Cross platform audio capture SDK

Readme

@recappi/sdk

CI

Platform support

| Feature | macOS | Windows | Linux (x64 GNU) | | --------------------------------------------- | ----- | ------- | ---------------------------------- | | decodeAudio / decodeAudioSync | Yes | Yes | Yes | | ShareableContent.applications() | Yes | Yes | Yes | | ShareableContent.applicationWithProcessId() | Yes | Yes | Yes | | ShareableContent.onApplicationListChanged() | Yes | Yes | Yes (polling) | | ShareableContent.isUsingMicrophone() | Yes | Yes | Yes (PulseAudio) | | ShareableContent.onAppStateChanged() | Yes | Yes | Yes (polling) | | ShareableContent.tapGlobalAudio() | Yes | Yes | Yes (PulseAudio monitor) | | ShareableContent.tapAudio() | Yes | Yes | Yes (dedicated Pulse sink reroute) |

Published Linux artifacts currently target x86_64-unknown-linux-gnu. The Linux implementation ships the same top-level ShareableContent surface as macOS and Windows, but it uses a PulseAudio-compatible userspace and shells out to pactl / ffmpeg, so capture requires those tools to be available at runtime.

If your application needs to choose a Linux fallback backend dynamically, use getPlatformCapabilities() instead of hard-coding platform checks. On Linux, those booleans reflect the currently reachable runtime prerequisites for each capture path, not just whether the functions are exported.

import { getPlatformCapabilities } from '@recappi/sdk'

const capabilities = getPlatformCapabilities()

if (capabilities.tapGlobalAudio) {
  console.log('Use Recappi for realtime capture')
} else {
  console.log('Use your Linux-specific fallback backend')
}

Usage

Recording system audio

Available on macOS, Windows, and Linux. Linux capture requires a PulseAudio-compatible server plus pactl and ffmpeg.

Both input and output devices are recording, mixed into a single audio stream.

import { writeFile } from 'node:fs/promises'
import { setTimeout } from 'node:timers/promises'

import { ShareableContent } from '@recappi/sdk'
import { createWavBuffer } from '@recappi/sdk/encode-wav'

const WavBuffers = []

let totalLength = 0

const session = ShareableContent.tapGlobalAudio([], (err, samples) => {
  if (err) {
    console.error('Error capturing audio:', err)
    return
  }
  WavBuffers.push(samples)
  totalLength += samples.length
})

console.info('Recording audio for 5 seconds...')

await setTimeout(5000) // Record for 5 seconds

session.stop()

console.info(`Recording stopped. Writing ${totalLength} samples to output.wav...`)

const { buf: contactedBuffer } = WavBuffers.reduce(
  ({ buf, offset }, cur) => {
    buf.set(cur, offset)
    return {
      buf,
      offset: offset + cur.length,
    }
  },
  {
    buf: new Float32Array(totalLength),
    offset: 0,
  },
)

console.log(`Creating WAV buffer ...`)

const wavBuffer = Buffer.from(
  createWavBuffer(contactedBuffer, {
    sampleRate: session.sampleRate,
    numChannels: session.channels,
  }),
)

await writeFile('output.wav', wavBuffer)

Listing running applications

Available on macOS, Windows, and Linux.

import { ShareableContent } from '@recappi/sdk'

const apps = ShareableContent.applications()

for (const app of apps) {
  console.log(`Name: ${app.name}, PID: ${app.processId}`)
}

Recording specific application

Available on macOS, Windows, and Linux. On Windows, tapAudio() currently uses the same capture backend as tapGlobalAudio() and does not isolate a single process stream yet. On Linux, tapAudio() reroutes matching Pulse sink-inputs into a dedicated capture sink and records that sink's monitor. This is best-effort and depends on the target application exposing movable Pulse streams.

import { ShareableContent } from '@recappi/sdk'

const apps = ShareableContent.applications()
const musicApp = apps.find((app) => app.name === 'Music')

if (musicApp) {
  const session = ShareableContent.tapAudio(musicApp.processId, (err, samples) => {
    if (err) {
      console.error('Error capturing audio:', err)
      return
    }
    // Process samples...
  })

  // Stop recording after 5 seconds
  setTimeout(() => {
    session.stop()
  }, 5000)
}

Playground

yarn install
yarn build
yarn workspace playground dev:server
yarn workspace playground dev:web

Local Linux Iteration From macOS

Use the bundled Docker environment to exercise the Linux backend locally from a macOS workstation.

bash ./scripts/test-linux-docker.sh

If you want an interactive shell inside the same Linux image:

bash ./scripts/docker-linux.sh bash

The Docker image installs Rust, Node.js, PulseAudio, pactl, and ffmpeg, so the Linux binding tests can run without depending on the host machine.