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

headset

v0.5.0

Published

node library for headsets

Downloads

12

Readme

Headset for node

A node.js library for headsets.

Install

npm install headset

*extra steps for node-webkit

Usage

Get a headset

var headset = require('headset').get()

Optionally pass you own options to find a headset

var headset = require('headset').get(options);

Get all headsets

require('headset').devices();

Optionally you can pass true to show all connected USB HID Devices. This can be useful if the Headset is not detected, or if you are trying out this library with unsupported devices.

require('headset').devices(showUnsupported);

Events

connected

The connected event fires every time a headset connection is made. This will also fire after a automatic / manual reconnect.

headset.on('connected', function(){
    // it is now safe to write to the headset
});

headset.once // use this for code that should only run on the next connect (initialization)

disconnected

headset.on('error', function(err){
    // err contains details
});

Headset specific events

You can also listen to events specified in device configuration. (see supported.json)

headset.on('accept', function() { //Call accepted });

Methods

Connect

The connect method gives you the ability to issue a manual connect. This is done automatically the first time (when you get the headset).

Headset specific methods

Methods specficified in a device configuration are also available to use. (see supported.json) If you are unsure which headset is attached and if it supports a certain method, then check if it exists first.

if(headset.lightOn)
  headset.lightOn();

Adding events (handle Reads from USB)

If you test your own unsupported device / features you can add events as follows

headset.addEvent(name, hexString);

Adding methods (write to USB)

If you test your own unsupported device / features you can add methods as follows

headset.addMethod(name, hexString);

Close method

Use this when you are done using the headset

headset.close();

Supports

All USB Headsets with UC or Lync support should work, but only the following have been tested so far.

  • Jabra PRO 935
  • Jabra PRO 930
  • Logitech H820e
  • Jabra PRO 9470
  • Jabra PRO 9450
  • BUA 200M
  • Plantronics D100

Test

Currently testing is just to manually see if a headset works / can be found.

Trying an unsupported headset

If you want to try an unsupported headset just do npm test and follow the instructions. If a device is found that you can recognize, you can now use the details to manually .get(options) the headset. If you find/add a working device it would be great if you report back here under issues or submit a pull request on supported.json.

Node-webkit

Headset relies on node-hid. node-hid needs to be built for each platform and specific version of node-webkit, so to make it work you need build node-hid using nw-gyp https://github.com/rogerwang/node-webkit/wiki/Build-native-modules-with-nw-gyp