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

pw-client

v1.0.0

Published

Node.js wrapper for developing PipeWire clients

Downloads

4

Readme

PipeWire Node.js Client

Node.js library for PipeWire audio programming. Build audio applications, synthesizers, and streaming solutions using modern JavaScript patterns.

✨ Why This Library?

  • 🚀 Real-Time Performance - Native C++ core optimized for low-latency audio
  • 🎵 JavaScript-Friendly - Develop using idiomatic JavaScript
  • 🔧 Modern Patterns - ES modules, iterators, explicit resource managment with using, built with TypeScript
  • 🎛️ PipeWire Native - Direct integration with Linux's professional audio system

🚀 Quick Start

Prerequisites

This library requires PipeWire development libraries to be installed on your system:

Ubuntu/Debian

sudo apt update
sudo apt install libpipewire-0.3-dev pkg-config

Fedora/RHEL/Rocky Linux

sudo dnf install pipewire-devel pkgconf-pkg-config

Arch Linux

sudo pacman -S pipewire pkg-config

Installation

npm install pw-client
import { startSession } from "pw-client";

// Create processing thread for PipeWire
const session = await startSession();

try {
  // Create audio stream
  const stream = await session.createAudioOutputStream({
    name: "My Audio App",
    channels: 2, // Stereo output
  });

  try {
    await stream.connect();

    // Generate PCM audio samples
    function* generateTone(frequency: number, duration: number) {
      const totalSamples = duration * stream.rate * stream.channels;
      const cycle = (Math.PI * 2) / stream.rate;
      let phase = 0;

      for (let i = 0; i < totalSamples; i += stream.channels) {
        const sample = Math.sin(phase * frequency) * 0.2; // 20% volume

        // Output to both stereo channels
        for (let ch = 0; ch < stream.channels; ch++) {
          yield sample;
        }
        phase += cycle;
      }
    }

    // Play 2-second A4 note
    await stream.write(generateTone(440, 2.0));
  } finally {
    await stream.dispose(); // Clean up stream
  }
} finally {
  await session.dispose(); // Clean up session
}

📁 Complete Example: Run the full example with npx tsx examples/quick-start.mts

📚 Documentation

🎓 Tutorials - Learn by doing

🔧 How-to Guides - Solve specific problems

📖 Reference - Look up technical details

💡 Explanation - Understand the concepts

🎵 Examples

Check out the examples/ directory for complete working demos. Use npx tsx to run them without having to compile:

npx tsx examples/getting-started.mts

� Troubleshooting

Installation Issues

"Package 'pipewire-0.3' not found"

  • Install PipeWire development headers (see Prerequisites above)
  • Verify with: pkg-config --exists pipewire-0.3 && echo "PipeWire found"

"node-gyp rebuild failed"

  • Ensure you have build tools: sudo apt install build-essential (Ubuntu/Debian)
  • Check Node.js version: node --version (requires >= 22.0.0)
  • Try cleaning build cache: npm run build:native --clean

"libpipewire-0.3.so not found at runtime"

  • Install PipeWire runtime: sudo apt install pipewire (Ubuntu/Debian)
  • Check if PipeWire is running: systemctl --user status pipewire

Runtime Issues

"Failed to connect to PipeWire daemon"

  • Ensure PipeWire is running: systemctl --user start pipewire
  • Check permissions: Your user should be in the audio group

For more help:

�📋 Prerequisites

  • Linux with PipeWire - PipeWire 0.3+ required
  • Node.js 22+ - ES modules and modern features required
  • Build tools - GCC, make, Python 3
  • PipeWire headers - libpipewire-0.3-dev package

🤝 Contributing

  1. Read Contributing Guidelines
  2. Check Architecture Overview
  3. Follow Coding Style
  4. See Documentation Authoring Guide for docs/examples
  5. Run examples to test changes

📄 License

MIT License - see LICENSE file for details.


🎵 Build amazing audio applications with modern JavaScript and professional PipeWire performance!