<commit_before>USB Library for Node.JS
===============================

Node.JS library for communicating with USB devices in JavaScript / CoffeeScript.

This is a refactoring / rewrite of <NAME>'s [node-usb](https://github.com/schakko/node-usb). The API is not compatible (hopefully you find it an improvement).

It's based entirely on libusb's asynchronous API for better efficiency, and provides a stream API for continuously streaming data or events.

Tested with Node 0.10/Fedora and Node 0.10/WinXP.

Installation
============

Libusb is required. Older versions of libusb segfault when using bulk or interrupt endpoints.
Use [libusb](http://libusb.org) or [libusbx](http://libusbx.org) 1.0.9 or greater.

**Ubuntu/Debian:** `sudo apt-get install libusb-1.0-0-dev`
**Fedora:** `sudo yum install libusbx-devel`

**OSX:** `brew install libusb pkg-config`

**Windows:** Download a Windows Binary package from http://libusbx.org/ and extract it at `C:\Program Files\libusb`. Use [Zadig](http://sourceforge.net/projects/libwdi/files/zadig/) to install the WinUSB driver for your USB device. Otherwise you will get a `LIBUSB_ERROR_NOT_SUPPORTED` when attempting to open devices.

Then, just run

	npm install usb

to install from npm. See the bottom of this page for instructions for building from a git checkout.

API
===

  var usb = require('usb')

usb
---

Top-level object.

### usb.getDevices()
Return a list of `Device` objects for the USB devices attached to the system.

### usb.findByIds(vid, pid)
Convenience method to get the first device with the specified VID and PID, or `undefined` if no such device is present.

### usb.LIBUSB_*
Constant properties from libusb

### usb.setDebugLevel(level : int)
Set the libusb debug level (between 0 and 4)

Device
------

Represents a USB device.

### .busNumber<commit_msg>readme: getDevices() should be getDeviceList()<commit_after>USB Library for Node.JS
===============================

Node.JS library for communicating with USB devices in JavaScript / CoffeeScript.

This is a refactoring / rewrite of <NAME>'s [node-usb](https://github.com/schakko/node-usb). The API is not compatible (hopefully you find it an improvement).

It's based entirely on libusb's asynchronous API for better efficiency, and provides a stream API for continuously streaming data or events.

Tested with Node 0.10/Fedora and Node 0.10/WinXP.

Installation
============

Libusb is required. Older versions of libusb segfault when using bulk or interrupt endpoints.
Use [libusb](http://libusb.org) or [libusbx](http://libusbx.org) 1.0.9 or greater.

**Ubuntu/Debian:** `sudo apt-get install libusb-1.0-0-dev`
**Fedora:** `sudo yum install libusbx-devel`

**OSX:** `brew install libusb pkg-config`

**Windows:** Download a Windows Binary package from http://libusbx.org/ and extract it at `C:\Program Files\libusb`. Use [Zadig](http://sourceforge.net/projects/libwdi/files/zadig/) to install the WinUSB driver for your USB device. Otherwise you will get a `LIBUSB_ERROR_NOT_SUPPORTED` when attempting to open devices.

Then, just run

	npm install usb

to install from npm. See the bottom of this page for instructions for building from a git checkout.

API
===

  var usb = require('usb')

usb
---

Top-level object.

### usb.getDeviceList()
Return a list of `Device` objects for the USB devices attached to the system.

### usb.findByIds(vid, pid)
Convenience method to get the first device with the specified VID and PID, or `undefined` if no such device is present.

### usb.LIBUSB_*
Constant properties from libusb

### usb.setDebugLevel(level : int)
Set the libusb debug level (between 0 and 4)

Device
------

Represents a USB device.

### .busNumber
{'fraction_non_alphanumeric': 0.12222222222222222, 'fraction_numerical': 0.007588075880758808, 'mean_word_length': 4.372634643377001, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2385607', 'n_tokens_mistral': 1139, 'n_tokens_neox': 1068, 'n_words': 453}