{
  "name": "node-hid",
  "description": "USB HID device access library",
  "version": "0.3.2",
  "author": {
    "name": "Hans Hübner",
    "email": "hans.huebner@gmail.com",
    "url": "https://github.com/hanshuebner"
  },
  "contributors": [
    {
      "name": "Blake Miner",
      "email": "miner.blake@gmail.com"
    }
  ],
  "repository": {
    "type": "git",
    "url": "git://github.com/hanshuebner/node-hid.git"
  },
  "scripts": {
    "prepublish": "git submodule update --init",
    "install": "node-gyp rebuild"
  },
  "main": "./index.js",
  "engines": {
    "node": ">=0.8.0"
  },
  "license": "MIT/X11",
  "dependencies": {
    "nan": "^1.2.0"
  },
  "devDependencies": {},
  "gypfile": true,
  "readme": "# node-hid - Access USB HID devices from node.js #\n\n## Installation\n\n### Prerequisites:\n\n* Mac OS (I use 10.6.8) or Linux (kernel 2.6+) or Windows XP+\n* node.js v0.8\n* libudev-dev (Linux only)\n* libusb-1.0-0-dev (Ubuntu versions missing `libusb.h` only)\n* git\n\n### Compile from source on Linux or OSX\n\nUse npm to execute all installation steps:\n\n```\nnpm install\n```\n\n### Compile from source on Windows\n\nUse node-gyp to compile the extension.\n\nPlease note that Windows support is incomplete and needs some work\nto pull it to the same level as on Linux and OSX.  See issues #10\nand #15 in github for discussion.  Pull requests to improve Windows\nsupport would be welcome.\n\n## Test it\n\nIn the ```src/``` directory, various JavaScript programs can be found\nthat talk to specific devices in some way.  The ```show-devices.js```\nprogram can be used to display all HID devices in the system.\n\n## How to Use\n\n### Load the extension\n\n```\nvar HID = require('node-hid');\n```\n\n### Get a list of all HID devices in the system:\n\n```\nvar devices = HID.devices()\n```\n\ndevices will contain an array of objects, one for each HID device\navailable.  Of particular interest are the ```vendorId``` and\n```productId```, as they uniquely identify a device, and the\n```path```, which is needed to open a particular device.\n\nHere is some sample output:\n```\nHID.devices();\n[ { vendorId: 1452,\n    productId: 595,\n    path: 'USB_05ac_0253_0x100a148e0',\n    serialNumber: '',\n    manufacturer: 'Apple Inc.',\n    product: 'Apple Internal Keyboard / Trackpad',\n    release: 280,\n    interface: -1 },\n  { vendorId: 1452,\n    productId: 595,\n    path: 'USB_05ac_0253_0x100a14e20',\n    serialNumber: '',\n    manufacturer: 'Apple Inc.',\n    product: 'Apple Internal Keyboard / Trackpad',\n    release: 280,\n    interface: -1 },\n<and more>\n```\n\n### Opening a device\n\nBefore a device can be read from or written to, it must be opened:\n\n```\nvar device = new HID.HID(path);\n```\n\n```device``` will contain a handle to the device.  The ```path``` can\nbe determined by a prior HID.devices() call.  If an error occurs\nopening the device, an exception will be thrown.\n\n### Reading from a device\n\nReading from a device is performed by registering a \"data\" event\nhandler:\n\n```\ndevice.on(\"data\", function(data) {});\n```\n\nYou can also listen for errors like this:\n\n```\ndevice.on(\"error\", function(err) {});\n```\n\nAll reading is asynchronous.\n\n### Writing to a device\n\nWriting to a device is performed using the write call in a device\nhandle.  All writing is synchronous.\n\n```\ndevice.write([0x00, 0x01, 0x01, 0x05, 0xff, 0xff]);\n```\n\n### Support\n\nI can only provide limited support, in particular for operating\nsystems and devices that I don't know.  Please use the\n[node-hid Google Group](https://groups.google.com/d/forum/node-hid) \nfor general support inquiries (node-hid@googlegroups.com).\n\n## Complete API\n\n```\nvar device = new HID.HID(path);\n```\n\n### Event: \"data\"\n\n- `chunk` - Buffer - the data read from the device\n\n### Event: \"error\"\n\n- `error` - The error Object emitted\n\n### device.write(data)\n\n- `data` - the data to be synchronously written to the device\n\n### device.close()\n\nCloses the device. Subsequent reads will raise an error.\n\n### device.pause()\n\nPauses reading and the emission of `data` events.\n\n### device.resume()\n\nThis method will cause the HID device to resume emmitting `data` events.\nIf no listeners are registered for the `data` event, data will be lost.\n\nWhen a `data` event is registered for this HID device, this method will\nbe automatically called.\n\n### device.read(callback)\n\nLow-level function call to initiate an asynchronous read from the device.\n`callback` is of the form `callback(err, data)`\n",
  "readmeFilename": "README.md",
  "bugs": {
    "url": "https://github.com/hanshuebner/node-hid/issues"
  },
  "homepage": "https://github.com/hanshuebner/node-hid",
  "_id": "node-hid@0.3.2",
  "dist": {
    "shasum": "0faeb954b51237766143913d4bc54c84c9541e51"
  },
  "_from": "https://github.com/natevw/node-hid/releases/download/0.3.2/node-hid-0.3.2.tgz",
  "_resolved": "https://github.com/natevw/node-hid/releases/download/0.3.2/node-hid-0.3.2.tgz"
}
