Skip to content

Node.js implementation of the WebUSB Specification

License

Notifications You must be signed in to change notification settings

thegecko/webusb

Repository files navigation

⚠️ This package is deprecated, please use the WebUSB API in the usb package instead ⚠️

Node WebUSB

Node.js implementation of the WebUSB Specification

Circle CI npm Licence MIT

Prerequisites

Node.js > v8.14.0, which includes npm.

Installation

$ npm install webusb

Getting Started

See the examples in examples or view the API documentation at:

https://thegecko.github.io/webusb/

Specification

The WebUSB specification can be found here:

https://wicg.github.io/webusb/

Implementation Status

USB

  • getDevices()
  • requestDevice()

USBDevice

  • usbVersionMajor
  • usbVersionMinor
  • usbVersionSubminor
  • deviceClass
  • deviceSubclass
  • deviceProtocol
  • vendorId
  • productId
  • deviceVersionMajor
  • deviceVersionMinor
  • deviceVersionSubminor
  • manufacturerName
  • productName
  • serialNumber
  • configuration
  • configurations
  • opened
  • open()
  • close()
  • selectConfiguration()
  • claimInterface()
  • releaseInterface()
  • selectAlternateInterface()
  • controlTransferIn()
  • controlTransferOut() - bytesWritten always equals the initial buffer length
  • transferIn()
  • transferOut() - bytesWritten always equals the initial buffer length
  • clearHalt()
  • reset()
  • isochronousTransferIn() - currently unsupported in node-usb
  • isochronousTransferOut() - currently unsupported in node-usb

Events

  • connect
  • disconnect

Other

  • USBDevice.url
  • Device selector hook
  • API Documentation
  • Examples