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

@johan-sports/subdevil

v0.1.0

Published

Cross-platform USB metadata

Downloads

3

Readme

Subdevil

Cross-platform USB metadata. Inspired by CargoSense's USBDriver.

Platforms

  • OSX
  • Windows
  • ~~Linux~~

Requirements

  • Node.js >= v5.x

Install

From NPM:

$ npm install subdevil

From git:

$ npm install git://github.com/johan-sports/subdevil

Usage

Include the subdevil library:

var subdevil = require('subdevil');

Poll and print available USB devices:

subdevil.poll().then(function(devices) {
  console.log(devices.length + ' USB devices connected.');
  devices.forEach(function(dev) {
    console.log('====================');
    console.log(dev);
    console.log('====================');
  }):
}).catch(function(error){
  console.log('Something went wrong: ' + error);
});

Get a specific USB device by ID:

subdevil.get('0x22B3-0xEF23-IDQ21AS23AB').then(function(dev) {
  console.log('Device found: ' + dev)
});

Unmount a device (if mounted):

subdevil.unmount('0x22B3-0xEF23-IDQ21AS23AB').then(function() {
  console.log('Device unmounted successfully');
}).catch(function() { 
  console.log('Device unmount failed'); 
});

Set the log file to use for debug information:

subdevil.setLogFile('subdevil-debug.log');

A device is represented as an object containing these attributes:

{
  id: '0x22B3-0xEF23-IDQ21AS23AB', // Unique ID for attached device
  vendorCode: '0x22B3',            // Hex for USB vendor ID
  productCode: '0xEF23',           // Hex for USB product ID
  manufacturer: 'Foo Bar Technologies', // Name of manufacturer, if available
  product: 'Code-o-meter 3000',    // Name of product, if available
  serialNumber: 'IDQ21AS23AB',     // Serial number of device, if available
  mount: '/Volumes/MY_FILES'       // Path to volume mount point, if available
}

Test

npm test

Contributing

Contributions are more than welcome. Make sure the tests pass, open a PR and add yourself to the CONTRIBUTORS file.

License

See LICENSE