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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@interactivefitness/peripherals

v0.4.6

Published

IF Peripherals

Downloads

4

Readme

Interactive Fitness Peripherals

This abstracts the Pulse Audio and Bluez DBus APIs into an easy to use module.

Leveraging these APIs, this code watches for bluetooth peripheral changes and audio interface changes and using an event-driven architecture gives you the ability to make adjustments to these.

Install

It depends on the bluez and @interactivefitness/paclient

sudo apt-get install -y curl pkg-config libdbus-1-dev libdbus-glib-1-dev
yarn add @interactivefitness/peripherals @interactivefitness/paclient bluez

Usage

import { Headsets } from "./Headsets";
import Express from "express";

const app = Express();
const hs = new Headsets();
const port = 4141;

app.get("/", (req, res) => res.send("Hello World!"));

app.get("/headsets", (req, res) => res.send(hs.devices));

// init headsets
hs.init().then(() => {
  app.listen({ port: port }, () =>
    console.log(`Example app listening on port ${port}!`)
  );
});
/*
process.on("SIGINT", function() {
  hs.onDestroy(function() {
    console.error("connection closed due to app termination");
    return process.exit(0);
  });
});
*/

References

Bluez 5.50

https://launchpad.net/~bluetooth/+archive/ubuntu/bluez

The below would normally work, but it is not build for xenial.

sudo add-apt-repository ppa:bluetooth/bluez
sudo apt-get update
sudo apt-get install -y bluez
#
sudo apt-get install -y libglib2.0-dev libdbus-1-dev

So we have to do it as follows:

sudo apt install ./libreadline7_7.0-3_amd64.deb
cat > /etc/apt/sources.list.d/bluetooth-ubuntu-bluez-bionic.list
deb http://ppa.launchpad.net/bluetooth/bluez/ubuntu bionic main
# deb-src http://ppa.launchpad.net/bluetooth/bluez/ubuntu bionic main
sudo apt-get update
sudo apt-get install -y bluez

MacOS

See https://github.com/zbentley/dbus-osx-examples

brew install dbus
brew services start dbus
launchctl getenv DBUS_LAUNCHD_SESSION_BUS_SOCKET
export DISPLAY=':0'
export DBUS_SESSION_BUS_ADDRESS = 'unix:path=/run/dbus/system_bus_socket'

Manual Pulse Audio Configuration

bluetoothctl
pulseaudio --start
pactl load-module module-bluetooth-discover
pactl list short sinks
pacmd list-sinks | grep -e 'name:' -e 'index:'
pactl set-card-profile 3 a2dp_sink
pactl set-default-sink "bluez_sink.04_AA_00_0F_5C_94"