serialport
Advanced tools
Comparing version 10.2.2 to 10.3.0
@@ -6,4 +6,4 @@ import { ErrorCallback, OpenOptions, SerialPortStream } from '@serialport/stream'; | ||
static list: () => Promise<import("@serialport/bindings-cpp").PortInfo[]>; | ||
static readonly MockBinding: MockBindingInterface; | ||
static readonly binding: MockBindingInterface; | ||
constructor(options: SerialPortMockOpenOptions, openCallback?: ErrorCallback); | ||
} |
@@ -17,2 +17,2 @@ "use strict"; | ||
SerialPortMock.list = binding_mock_1.MockBinding.list; | ||
SerialPortMock.MockBinding = binding_mock_1.MockBinding; | ||
SerialPortMock.binding = binding_mock_1.MockBinding; |
@@ -1,57 +0,8 @@ | ||
import { ErrorCallback, OpenOptions, SerialPortStream } from '@serialport/stream'; | ||
import { AutoDetectTypes } from '@serialport/bindings-cpp'; | ||
export declare type SerialPortOpenOptions = Omit<OpenOptions<AutoDetectTypes>, 'binding'>; | ||
export declare class SerialPort extends SerialPortStream<AutoDetectTypes> { | ||
/** | ||
* Retrieves a list of available serial ports with metadata. Only the `path` is guaranteed. If unavailable the other fields will be undefined. The `path` is either the path or an identifier (eg `COM1`) used to open the SerialPort. | ||
* | ||
* We make an effort to identify the hardware attached and have consistent results between systems. Linux and OS X are mostly consistent. Windows relies on 3rd party device drivers for the information and is unable to guarantee the information. On windows If you have a USB connected device can we provide a serial number otherwise it will be `undefined`. The `pnpId` and `locationId` are not the same or present on all systems. The examples below were run with the same Arduino Uno. | ||
* Resolves with the list of available serial ports. | ||
* @example | ||
```js | ||
// OSX example port | ||
{ | ||
path: '/dev/tty.usbmodem1421', | ||
manufacturer: 'Arduino (www.arduino.cc)', | ||
serialNumber: '752303138333518011C1', | ||
pnpId: undefined, | ||
locationId: '14500000', | ||
productId: '0043', | ||
vendorId: '2341' | ||
} | ||
// Linux example port | ||
{ | ||
path: '/dev/ttyACM0', | ||
manufacturer: 'Arduino (www.arduino.cc)', | ||
serialNumber: '752303138333518011C1', | ||
pnpId: 'usb-Arduino__www.arduino.cc__0043_752303138333518011C1-if00', | ||
locationId: undefined, | ||
productId: '0043', | ||
vendorId: '2341' | ||
} | ||
// Windows example port | ||
{ | ||
path: 'COM3', | ||
manufacturer: 'Arduino LLC (www.arduino.cc)', | ||
serialNumber: '752303138333518011C1', | ||
pnpId: 'USB\\VID_2341&PID_0043\\752303138333518011C1', | ||
locationId: 'Port_#0003.Hub_#0001', | ||
productId: '0043', | ||
vendorId: '2341' | ||
} | ||
``` | ||
```js | ||
var SerialPort = require('serialport'); | ||
// promise approach | ||
SerialPort.list() | ||
.then(ports) {...}); | ||
.catch(err) {...}); | ||
``` | ||
*/ | ||
import { ErrorCallback, SerialPortStream, StreamOptions } from '@serialport/stream'; | ||
import { AutoDetectTypes, OpenOptionsFromBinding } from '@serialport/bindings-cpp'; | ||
export declare type SerialPortOpenOptions<T extends AutoDetectTypes> = Omit<StreamOptions<T>, 'binding'> & OpenOptionsFromBinding<T>; | ||
export declare class SerialPort<T extends AutoDetectTypes = AutoDetectTypes> extends SerialPortStream<T> { | ||
static list: () => Promise<import("@serialport/bindings-cpp").PortInfo[]>; | ||
constructor(options: SerialPortOpenOptions, openCallback?: ErrorCallback); | ||
static readonly binding: AutoDetectTypes; | ||
constructor(options: SerialPortOpenOptions<T>, openCallback?: ErrorCallback); | ||
} |
@@ -17,52 +17,3 @@ "use strict"; | ||
exports.SerialPort = SerialPort; | ||
/** | ||
* Retrieves a list of available serial ports with metadata. Only the `path` is guaranteed. If unavailable the other fields will be undefined. The `path` is either the path or an identifier (eg `COM1`) used to open the SerialPort. | ||
* | ||
* We make an effort to identify the hardware attached and have consistent results between systems. Linux and OS X are mostly consistent. Windows relies on 3rd party device drivers for the information and is unable to guarantee the information. On windows If you have a USB connected device can we provide a serial number otherwise it will be `undefined`. The `pnpId` and `locationId` are not the same or present on all systems. The examples below were run with the same Arduino Uno. | ||
* Resolves with the list of available serial ports. | ||
* @example | ||
```js | ||
// OSX example port | ||
{ | ||
path: '/dev/tty.usbmodem1421', | ||
manufacturer: 'Arduino (www.arduino.cc)', | ||
serialNumber: '752303138333518011C1', | ||
pnpId: undefined, | ||
locationId: '14500000', | ||
productId: '0043', | ||
vendorId: '2341' | ||
} | ||
// Linux example port | ||
{ | ||
path: '/dev/ttyACM0', | ||
manufacturer: 'Arduino (www.arduino.cc)', | ||
serialNumber: '752303138333518011C1', | ||
pnpId: 'usb-Arduino__www.arduino.cc__0043_752303138333518011C1-if00', | ||
locationId: undefined, | ||
productId: '0043', | ||
vendorId: '2341' | ||
} | ||
// Windows example port | ||
{ | ||
path: 'COM3', | ||
manufacturer: 'Arduino LLC (www.arduino.cc)', | ||
serialNumber: '752303138333518011C1', | ||
pnpId: 'USB\\VID_2341&PID_0043\\752303138333518011C1', | ||
locationId: 'Port_#0003.Hub_#0001', | ||
productId: '0043', | ||
vendorId: '2341' | ||
} | ||
``` | ||
```js | ||
var SerialPort = require('serialport'); | ||
// promise approach | ||
SerialPort.list() | ||
.then(ports) {...}); | ||
.catch(err) {...}); | ||
``` | ||
*/ | ||
SerialPort.list = DetectedBinding.list; | ||
SerialPort.binding = DetectedBinding; |
{ | ||
"name": "serialport", | ||
"version": "10.2.2", | ||
"version": "10.3.0", | ||
"description": "Node.js package to access serial ports. Linux, OSX and Windows. Welcome your robotic JavaScript overlords. Better yet, program them!", | ||
@@ -54,15 +54,15 @@ "main": "./dist/index.js", | ||
"@serialport/binding-mock": "10.2.2", | ||
"@serialport/bindings-cpp": "10.6.2", | ||
"@serialport/parser-byte-length": "10.2.2", | ||
"@serialport/parser-cctalk": "10.2.2", | ||
"@serialport/parser-delimiter": "10.2.2", | ||
"@serialport/parser-inter-byte-timeout": "10.2.2", | ||
"@serialport/parser-packet-length": "10.2.2", | ||
"@serialport/parser-readline": "10.2.2", | ||
"@serialport/parser-ready": "10.2.2", | ||
"@serialport/parser-regex": "10.2.2", | ||
"@serialport/parser-slip-encoder": "10.2.2", | ||
"@serialport/parser-spacepacket": "10.2.2", | ||
"@serialport/stream": "10.2.2", | ||
"debug": "^4.3.2" | ||
"@serialport/bindings-cpp": "10.6.3", | ||
"@serialport/parser-byte-length": "10.3.0", | ||
"@serialport/parser-cctalk": "10.3.0", | ||
"@serialport/parser-delimiter": "10.3.0", | ||
"@serialport/parser-inter-byte-timeout": "10.3.0", | ||
"@serialport/parser-packet-length": "10.3.0", | ||
"@serialport/parser-readline": "10.3.0", | ||
"@serialport/parser-ready": "10.3.0", | ||
"@serialport/parser-regex": "10.3.0", | ||
"@serialport/parser-slip-encoder": "10.3.0", | ||
"@serialport/parser-spacepacket": "10.3.0", | ||
"@serialport/stream": "10.3.0", | ||
"debug": "^4.3.3" | ||
}, | ||
@@ -78,3 +78,3 @@ "engines": { | ||
}, | ||
"gitHead": "e8be807d39ad084ffc7e8609693da5a94cf8a9cb" | ||
"gitHead": "ceba41c8f89d911de210f2513aaae85fff3ab457" | ||
} |
@@ -1,2 +0,2 @@ | ||
# SerialPort | ||
# serialport | ||
@@ -8,17 +8,20 @@ Access serial ports with JavaScript. Linux, OSX and Windows. Welcome your robotic JavaScript overlords. Better yet, program them! | ||
## Quick Links | ||
- [**Guides**](https://serialport.io/docs/guide-about) | ||
- [**API Docs**](https://serialport.io/docs/api-serialport) | ||
- [The `serialport` package api docs](https://serialport.io/docs/api-serialport) | ||
### Serialport | ||
### Serialport | ||
- [`serialport`](https://serialport.io/docs/api-serialport) Chances are you're looking for the `serialport` package which provides a good set of defaults for most projects. However it is quite easy to mix and match the parts of serialport you need. | ||
### Bindings | ||
The Bindings provide a low level interface to work with your serialport. It is possible to use them alone but it's usually easier to use them with an interface. | ||
- [`@serialport/bindings-cpp`](https://serialport.io/docs/api-bindings) bindings for Linux, Mac and Windows | ||
- [`@serialport/binding-abstract`](https://serialport.io/docs/api-bindings-abstract) as an abstract class to use if you're making your own bindings | ||
- [`@serialport/binding-interface`](https://serialport.io/docs/api-bindings-interface) a typescript interface to use if you're making your own bindings | ||
- [`@serialport/binding-mock`](https://serialport.io/docs/api-binding-mock) for a mock binding package for testing | ||
### Interfaces | ||
Interfaces take a binding object and provide a different API on top of it. Currently we only ship a Node Stream Interface. | ||
@@ -45,2 +48,3 @@ | ||
### Developing node serialport projects | ||
1. Clone this repo `git clone git@github.com:serialport/node-serialport.git` | ||
@@ -53,22 +57,16 @@ 1. Run `npm install` to setup local package dependencies (run this any time you depend on a package local to this repo) | ||
You can develop the docs by running | ||
You can develop the docs with in the [website repo](https://github.com/serialport/website). | ||
```bash | ||
npm run docs:dev | ||
``` | ||
Docs are automatically built with [vercel](https://vercel.com/) including previews on branches. The main branch is deployed to https://serialport.io | ||
And build them by running | ||
```bash | ||
npm run docs | ||
``` | ||
## License | ||
Docs are automatically built with [netlify](https://www.netlify.com/pricing/) including previews on branches. The master branch is deployed to https://serialport.io | ||
## License | ||
SerialPort packages are all [MIT licensed](LICENSE) and all it's dependencies are MIT licensed. | ||
## Code of Conduct | ||
SerialPort follows the [Nodebots Code of Conduct](http://nodebots.io/conduct.html). While the code is MIT licensed participation in the community has some rules to make this a good place to work and learn. | ||
### TLDR | ||
- Be respectful. | ||
@@ -90,5 +88,5 @@ - Abusive behavior is never tolerated. | ||
**Maintainers** | ||
### Maintainers | ||
- [Francis Gulotta](https://twitter.com/reconbot) | [reconbot](https://github.com/reconbot) | ||
- [Nick Hehr](https://twitter.com/hipsterbrown) | [hipsterbrown](https://github.com/hipsterbrown) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
12108
87
89
+ Added@serialport/bindings-cpp@10.6.3(transitive)
+ Added@serialport/parser-byte-length@10.3.0(transitive)
+ Added@serialport/parser-cctalk@10.3.0(transitive)
+ Added@serialport/parser-delimiter@10.3.0(transitive)
+ Added@serialport/parser-inter-byte-timeout@10.3.0(transitive)
+ Added@serialport/parser-packet-length@10.3.0(transitive)
+ Added@serialport/parser-readline@10.3.0(transitive)
+ Added@serialport/parser-ready@10.3.0(transitive)
+ Added@serialport/parser-regex@10.3.0(transitive)
+ Added@serialport/parser-slip-encoder@10.3.0(transitive)
+ Added@serialport/parser-spacepacket@10.3.0(transitive)
+ Added@serialport/stream@10.3.0(transitive)
- Removed@serialport/bindings-cpp@10.6.2(transitive)
- Removed@serialport/parser-byte-length@10.2.2(transitive)
- Removed@serialport/parser-cctalk@10.2.2(transitive)
- Removed@serialport/parser-delimiter@10.2.2(transitive)
- Removed@serialport/parser-inter-byte-timeout@10.2.2(transitive)
- Removed@serialport/parser-packet-length@10.2.2(transitive)
- Removed@serialport/parser-readline@10.2.2(transitive)
- Removed@serialport/parser-ready@10.2.2(transitive)
- Removed@serialport/parser-regex@10.2.2(transitive)
- Removed@serialport/parser-slip-encoder@10.2.2(transitive)
- Removed@serialport/parser-spacepacket@10.2.2(transitive)
- Removed@serialport/stream@10.2.2(transitive)
Updated@serialport/stream@10.3.0
Updateddebug@^4.3.3