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

bare-miniaudio

v1.0.10

Published

MiniAudio Bare binding

Readme

bare-miniaudio

Native Bare bindings for miniaudio, exposing a small, promise-based API for playing audio files.

The binding wraps miniaudio's high-level engine. Sound-completion events are delivered from miniaudio's audio thread back to the JavaScript thread using a js_threadsafe_function, so play() can resolve when playback actually finishes.

Installation

npm install

Usage

const MiniAudio = require('bare-miniaudio')

const audio = new MiniAudio()

await audio.ready()

// Resolves with true when the track finishes, or false if stop() was called.
// Rejects if the file cannot be loaded.
const ended = await audio.play('/path/to/track.mp3')

if (ended) console.log('played to the end')
else console.log('stopped early')

// Stop playback early from elsewhere:
setTimeout(() => audio.stop(), 1000)

API

const audio = new MiniAudio()

Create an instance. Extends ready-resource.

await audio.ready()

Initialize the underlying miniaudio engine. Must be awaited before calling play().

await audio.play(path)

Load and start playing the file at path. Only one sound plays at a time — calling play() while another sound is playing stops the current one first.

Returns a promise that:

  • resolves with true when the sound plays through to the end,
  • resolves with false when playback is cut short by stop() (including the implicit stop when play() is called again), and
  • rejects if the file at path cannot be loaded.

The resolved value lets you tell the two cases apart, e.g. to advance to the next track only on natural completion.

audio.stop()

Stop the currently playing sound. No-op if nothing is playing. Resolves the pending play() promise with false and releases the sound's resources.

Building from source

The native addon is built with bare-make:

npm run build   # or:
npx bare-make generate
npx bare-make build
npx bare-make install

License

Apache-2.0