-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpackage.json
88 lines (88 loc) · 10.3 KB
/
package.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
{
"name": "serialport",
"version": "1.1.0",
"description": "Welcome your robotic javascript overlords. Better yet, program them!",
"author": {
"name": "Chris Williams",
"email": "[email protected]",
"url": "http://www.voodootikigod.com"
},
"main": "./serialport",
"repository": {
"type": "git",
"url": "git://github.com/voodootikigod/node-serialport.git"
},
"maintainers": [
{
"name": "Chris Williams",
"email": "[email protected]"
},
{
"name": "Joe Ferner",
"email": "[email protected]"
}
],
"dependencies": {
"bindings": "1.1.0",
"async": "0.1.18",
"sf": "0.1.6",
"optimist": "~0.3.4"
},
"devDependencies": {
"mocha": "*",
"chai": "*"
},
"engines": {
"node": ">= 0.7.0"
},
"bin": {
"serialportlist": "./bin/serialportList.js",
"serialportterm": "./bin/serialportTerminal.js"
},
"scripts": {
"test": "mocha -R spec -t 60s -s 60s",
"install": "node-gyp rebuild"
},
"gypfile": true,
"readme": "<pre>\n eeeee eeeee eeeee eeee e eeeee \n 8 8 8 88 8 8 8 8 8 \" \n 8e 8 8 8 8e 8 8eee 8e 8eeee \n 88 8 8 8 88 8 88 e 88 88 \n 88 8 8eee8 88ee8 88ee 88 8ee88 8ee88\n\n eeeee eeee eeeee e eeeee e eeeee eeeee eeeee eeeee \n 8 \" 8 8 8 8 8 8 8 8 8 8 88 8 8 8 \n 8eeee 8eee 8eee8e 8e 8eee8 8e 8eee8 8 8 8eee8e 8e \n 88 88 88 8 88 88 8 88 88 8 8 88 8 88 \n 8ee88 88ee 88 8 88 88 8 88eee 88 8eee8 88 8 88\n</pre>\n\nVersion: 1.1.0 - Released August 24, 2012 - Now with Windows Support!!!\n\n*****\n\nImagine a world where you can write JavaScript to control blenders, lights, security systems, or even robots. Yes, I said robots. That world is here and now with node-serialport. It provides a very simple interface to the low level serial port code necessary to program [Arduino](http://www.arduino.cc/) chipsets, [X10](http://www.smarthome.com/manuals/protocol.txt) wireless communications, or even the rising [Z-Wave](http://www.z-wave.com/modules/ZwaveStart/) and [Zigbee](http://www.zigbee.org/) standards. The physical world is your oyster with this goodie. For a full break down of why we made this, please read [NodeBots - The Rise of JS Robotics](http://www.voodootikigod.com/nodebots-the-rise-of-js-robotics).\n\n*****\n\nRobots, you say?\n================\n\nThis library is admittedly a base level toolkit for building amazing things with real world (including robots). Here are a couple of those amazing things that leverage node-serialport:\n\n* [firmata](https://github.com/jgautier/firmata) Talk natively to Arduino using the firmata protocol.\n* [tmpad](http://tmpvar.com/project/tmpad/) [source](https://github.com/tmpvar/tmpad) - a DIY midi pad using infrared, arduino, and nodejs. [Video](http://vimeo.com/34575470)\n* [duino](https://github.com/ecto/duino) - A higher level framework for working with Arduinos in node.js.\n* [Arduino Drinking Game Extravaganza](http://jsconf.eu/2011/arduino_drinking_game_extravaganza.html) - AKA \"The Russian\" a hexidecimal drinking game for geeks by Uxebu presented at JSConf EU 2011.\n* [Arduino controlling popcorn.js](https://gist.github.com/968773) - Controlling a popcorn.js video with an Arduino kit.\n* [Robotic JavaScript](http://jsconf.eu/2010/speaker/livingroombindmotion_function.html) - The first live presentation of the node-serialport code set as presented at JSConf EU 2010.\n* [devicestack](https://github.com/adrai/devicestack) - This module helps you to represent a device and its protocol.\n\nFor getting started with node-serialport, we recommend you begin with the following articles:\n\n* [Arduino Node Security Sensor Hacking](http://nexxylove.tumblr.com/post/20159263403/arduino-node-security-sensor-hacking) - A great all around \"how do I use this\" article.\n* [NodeBots - The Rise of JS Robotics](http://www.voodootikigod.com/nodebots-the-rise-of-js-robotics) - A survey article of why one would want to program robots in JS.\n* [Johnny-Five Getting Started Guide](https://github.com/rwldrn/johnny-five#setup-and-assemble-arduino) - Introduction to using the high level Johnny-Five library (awesome).\n\nHow To Use\n==========\n\nUsing node-serialport is pretty easy because it is pretty basic. It provides you with the building block to make great things, it is not a complete solution - just a cog in the (world domination) machine.\n\nTo Install\n----------\n\n<pre>\n npm install serialport\n</pre>\n\nThis assumes you have everything on your system necessary to compile ANY native module for Node.js. This may not be the case, though, so please ensure the following are true for your system before filing an issue about \"Does not install\". For all operatings systems, please ensure you have Python 2.x installed AND not 3.0, node-gyp (what we use to compile) requires Python 2.x.\n\n### Windows:\n\nEnsure you have Visual Studio 2010 installed. If you have any version OTHER THAN VS 2010, please read this: https://github.com/TooTallNate/node-gyp/issues/44 \n\n### Mac OS X:\n\nEnsure that you have at a minimum the xCode Command Line Tools installed appropriate for your system configuration. If you recently upgrade OS, it probably removed your installation of Command Line Tools, please verify before submitting a ticket.\n\n### Linux:\n\nYou know what you need for you system, basically your appropriate analog of build-essential. Keep rocking!\n\n\nTo Use\n------\n\nOpening a serial port:\n\n<pre>\n var SerialPort = require(\"serialport\").SerialPort\n var serialPort = new SerialPort(\"/dev/tty-usbserial1\", {\n baudrate: 57600\n });\n</pre>\n \nWhen opening a serial port, you can specify (in this order).\n\n1. Path to Serial Port - required.\n1. Options - optional and described below.\n\nThe options object allows you to pass named options to the serial port during initialization. The valid attributes for the options object are the following:\n\n* baudrate: Baud Rate, defaults to 9600. Must be one of: 115200, 57600, 38400, 19200, 9600, 4800, 2400, 1800, 1200, 600, 300, 200, 150, 134, 110, 75, or 50.\n* databits: Data Bits, defaults to 8. Must be one of: 8, 7, 6, or 5.\n* stopbits: Stop Bits, defaults to 1. Must be one of: 1 or 2.\n* parity: Parity, defaults to 'none'. Must be one of: 'none', 'even', 'mark', 'odd', 'space'\n* buffersize: Size of read buffer, defaults to 255. Must be an integer value.\n* parser: The parser engine to use with read data, defaults to rawPacket strategy which just emits the raw buffer as a \"data\" event. Can be any function that accepts EventEmitter as first parameter and the raw buffer as the second parameter.\n\n**Note, we have added support for either all lowercase OR camelcase of the options (thanks @jagautier), use whichever style you prefer.**\n\nopen event\n----------\n\nYou MUST wait for the open event to be emitted before reading/writing to the serial port. The open happens asynchronously so installing 'data' listeners and writing \nbefore the open event might result in... nothing at all.\n\nAssuming you are connected to a serial console, you would for example:\n\n<pre>\nserialPort.on(\"open\", function () {\n console.log('open');\n serialPort.on('data', function(data) {\n console.log('data received: ' + data);\n }); \n serialPort.write(\"ls\\n\", function(err, results) {\n console.log('err ' + err);\n console.log('results ' + results);\n }); \n});\n</pre>\n\nYou can also call the open function, in this case instanciate the serialport with an additional flag.\n\n<pre>\nvar SerialPort = require(\"serialport\").SerialPort\nvar serialPort = new SerialPort(\"/dev/tty-usbserial1\", {\n baudrate: 57600\n}, false); // this is the openImmediately flag [default is true]\n\nserialPort.open(function () {\n console.log('open');\n serialPort.on('data', function(data) {\n console.log('data received: ' + data);\n }); \n serialPort.write(\"ls\\n\", function(err, results) {\n console.log('err ' + err);\n console.log('results ' + results);\n }); \n});\n</pre>\n\nList Ports\n----------\n\nYou can also list the ports along with some metadata as well.\n\n<pre>\n serialport.list(function (err, ports) {\n ports.forEach(function(port) {\n console.log(port.comName);\n console.log(port.pnpId);\n console.log(port.manufacturer);\n });\n });\n</pre>\n\nParsers\n-------\n\nOut of the box, node-serialport provides two parsers one that simply emits the raw buffer as a data event and the other which provides familiar \"readline\" style parsing. To use the readline parser, you must provide a delimiter as such:\n\n<pre>\n var serialport = require(\"serialport\");\n var SerialPort = serialport.SerialPort; // localize object constructor\n \n var sp = new SerialPort(\"/dev/tty-usbserial1\", { \n parser: serialport.parsers.readline(\"\\n\") \n });\n</pre>\n\nTo use the raw parser, you just provide the function definition (or leave undefined):\n\n<pre>\n var serialport = require(\"serialport\");\n var SerialPort = serialport.SerialPort; // localize object constructor\n \n var sp = new SerialPort(\"/dev/tty-usbserial1\", { \n parser: serialport.parsers.raw\n });\n</pre>\n\n\nYou can get updates of new data from the Serial Port as follows:\n\n<pre>\n serialPort.on(\"data\", function (data) {\n sys.puts(\"here: \"+data);\n });\n</pre>\n\nYou can write to the serial port by sending a string or buffer to the write method as follows:\n\n<pre>\nserialPort.write(\"OMG IT WORKS\\r\");\n</pre>\n\nEnjoy and do cool things with this code.\n\n",
"readmeFilename": "README.md",
"contributors": [
{
"name": "Chris Williams",
"email": "[email protected]"
},
{
"name": "Joe Ferner",
"email": "[email protected]"
},
{
"name": "Esa-Matti Suuronen",
"email": "[email protected]"
},
{
"name": "Nathan Rajlich",
"email": "[email protected]"
},
{
"name": "Rick Waldron",
"email": "[email protected]"
},
{
"email": "w1nk"
},
{
"name": "Georges-Etienne Legendre",
"email": "legege"
},
{
"name": "Duane Johnson",
"email": "[email protected]"
},
{
"name": "Joe Ferner",
"email": "[email protected]"
}
],
"_id": "[email protected]",
"_from": "[email protected]"
}