diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index ee8142e..a7e4bac 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -1,74 +1,10 @@ -# Contributor Covenant Code of Conduct +# Nodebots Code of Conduct -## Our Pledge +SerialPort follows the nodebots code of conduct. The full text can be found at http://nodebots.io/conduct.html -In the interest of fostering an open and welcoming environment, we as -contributors and maintainers pledge to making participation in our project and -our community a harassment-free experience for everyone, regardless of age, body -size, disability, ethnicity, gender identity and expression, level of experience, -nationality, personal appearance, race, religion, or sexual identity and -orientation. - -## Our Standards - -Examples of behavior that contributes to creating a positive environment -include: - -* Using welcoming and inclusive language -* Being respectful of differing viewpoints and experiences -* Gracefully accepting constructive criticism -* Focusing on what is best for the community -* Showing empathy towards other community members - -Examples of unacceptable behavior by participants include: - -* The use of sexualized language or imagery and unwelcome sexual attention or -advances -* Trolling, insulting/derogatory comments, and personal or political attacks -* Public or private harassment -* Publishing others' private information, such as a physical or electronic - address, without explicit permission -* Other conduct which could reasonably be considered inappropriate in a - professional setting - -## Our Responsibilities - -Project maintainers are responsible for clarifying the standards of acceptable -behavior and are expected to take appropriate and fair corrective action in -response to any instances of unacceptable behavior. - -Project maintainers have the right and responsibility to remove, edit, or -reject comments, commits, code, wiki edits, issues, and other contributions -that are not aligned to this Code of Conduct, or to ban temporarily or -permanently any contributor for other behaviors that they deem inappropriate, -threatening, offensive, or harmful. - -## Scope - -This Code of Conduct applies both within project spaces and in public spaces -when an individual is representing the project or its community. Examples of -representing a project or community include using an official project e-mail -address, posting via an official social media account, or acting as an appointed -representative at an online or offline event. Representation of a project may be -further defined and clarified by project maintainers. - -## Enforcement - -Instances of abusive, harassing, or otherwise unacceptable behavior may be -reported by contacting the project team at francis@bocoup.com. All -complaints will be reviewed and investigated and will result in a response that -is deemed necessary and appropriate to the circumstances. The project team is -obligated to maintain confidentiality with regard to the reporter of an incident. -Further details of specific enforcement policies may be posted separately. - -Project maintainers who do not follow or enforce the Code of Conduct in good -faith may face temporary or permanent repercussions as determined by other -members of the project's leadership. - -## Attribution - -This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, -available at [http://contributor-covenant.org/version/1/4][version] - -[homepage]: http://contributor-covenant.org -[version]: http://contributor-covenant.org/version/1/4/ +## TLDR +- Be respectful. +- Abusive behavior is never tolerated. +- Data published to NodeBots is hosted at the discretion of the service administrators, and may be removed. +- Don't build evil robots. +- Violations of this code may result in swift and permanent expulsion from the NodeBots community. diff --git a/README.md b/README.md index 7deba7b..6440200 100644 --- a/README.md +++ b/README.md @@ -5,47 +5,40 @@ [](https://ci.appveyor.com/project/serialport/node-serialport/branch/master) [](https://greenkeeper.io/) -Working with serialports can be hard, this is a collection of projects that make it easier. +Working with serial ports can be hard, this is a collection of projects that make it easier. -Goto https://serialport.io/ to learn more. - -We currently have the following packages. - -- `serialport` [](http://npmjs.com/package/serialport) the only package you need to get started. -- `@serialport/stream` our traditional stream interface with nothing else -- `@serialport/binding-abstract` as an abstract class for all bindings -- `@serialport/binding-mock` for a mock binding package -- Parser Byte Length -- Parser cctalk -- Parser delimiter -- Parser readline -- Parser ready -- Parser regex -- Parser slip-encoder +> Go to https://serialport.io/ to learn more. ## Quick Answers to Important Questions +- [**Guides**](https://serialport.io/docs/guide-about) - [**API Docs**](https://serialport.io/docs/api-overview) -## Intro to Node-Serialport +Chances are you're looking for the [`serialport`](https://serialport.io/docs/api-serialport.md) 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. -Imagine a world where you can write JavaScript to control blenders, lights, security systems, or even robots. That's right—robots! Thanks to Node Serialport, that world is here. +## 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`](https://serialport.io/docs/api-bindings.md) bindings for Linux, Mac and Windows +- [`@serialport/binding-abstract`](https://serialport.io/docs/api-bindings-abstract.md) as an abstract class to use if you're making your own bindings +- [`@serialport/binding-mock`](https://serialport.io/docs/api-bindings-mock.md) for a mock binding package for testing -Node-Serialport provides an interface for the low-level serial port code necessary to control [Arduino](http://www.arduino.cc/) chipsets, X10 interfaces, [Zigbee](http://www.zigbee.org/) radios, highway signs, lcd screens, cash drawers, motor controllers, sensor packages, fork lifts, modems, drones, CNC machines, plotters, vending machines, ccTalk coin accecptors, SMS Gateways, RFID scanners and much more. If you have a hardware device with a [UART](https://en.wikipedia.org/wiki/Universal_asynchronous_receiver/transmitter) we can speak to it. The physical world is your oyster with this goodie. +## Interfaces +Interfaces take a binding object and provide a different API on top of it. Currently we only ship a Node Stream Interface. -For a full breakdown of why we made Node-Serialport, please read [NodeBots - The Rise of JS Robotics](http://www.voodootikigod.com/nodebots-the-rise-of-js-robotics). It explains why one would want to program robots in JS in the first place. It's not being against firmware but we can be better than it. +- [`@serialport/stream`](https://serialport.io/docs/api-stream) our traditional Node.js Stream interface -## API Documentation +## Parsers -- [**API Docs**](https://serialport.io/docs/api-overview) +Parsers are used to take raw binary data and transform them into usable messages. This may include tasks such as converting the data to text, emitting useful chunks of data when they have been fully received, or even validating protocols. +Parsers are traditionally Transform streams, but Duplex streams and other non stream interfaces are acceptable. -You can generate the docs by running - -```bash -npm run docs -``` - -And browsing to `./docs/index.html`. +- [@serialport/parser-byte-length](https://serialport.io/docs/api-parser-byte-length) +- [@serialport/parser-cctalk](https://serialport.io/docs/api-parser-cctalk) +- [@serialport/parser-delimiter](https://serialport.io/docs/api-parser-delimiter) +- [@serialport/parser-readline](https://serialport.io/docs/api-parser-readline) +- [@serialport/parser-ready](https://serialport.io/docs/api-parser-ready) +- [@serialport/parser-regex](https://serialport.io/docs/api-parser-regex) +- [@serialport/parser-slip-encoder](https://serialport.io/docs/api-parser-slip-encoder) ### Developing node serialport projects 1. Clone this repo `git clone git@github.com:node-serialport/node-serialport.git` @@ -54,5 +47,30 @@ And browsing to `./docs/index.html`. 1. Run `npm run generate` to generate a new project 1. Add dev dependencies to the root package.json and package dependencies to the package's one. +### Developing Docs + +You can develop the docs by running + +```bash +npm run docs:dev +``` + +And build them by running +```bash +npm run docs +``` + +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 or BSD licensed. + +## Code of Conduct +SerialPort follows the [Nodebots Code of Conduct](http://nodebots.io/conduct.html). + +### TLDR +- Be respectful. +- Abusive behavior is never tolerated. +- Data published to NodeBots is hosted at the discretion of the service administrators, and may be removed. +- Don't build evil robots. +- Violations of this code may result in swift and permanent expulsion from the NodeBots community. diff --git a/docs/api-overview.md b/docs/api-overview.md index 31530fa..43e00ad 100644 --- a/docs/api-overview.md +++ b/docs/api-overview.md @@ -1,6 +1,6 @@ --- id: api-overview -title: Serialport Packages +title: Packages Overview --- Chances are you're looking for the [`serialport`](api-serialport.md) 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. @@ -22,9 +22,10 @@ Parsers are used to take raw binary data and transform them into usable messages Parsers are traditionally Transform streams, but Duplex streams and other non stream interfaces are acceptable. -- [`@serialport/parser-byte-length`](api-parser-byte-length.md) -- [`@serialport/parser-delimiter`](api-parser-delimiter.md) -- [`@serialport/parser-readline`](api-parser-readline.md) -- [`@serialport/parser-ready`](api-parser-ready.md) -- [`@serialport/parser-regex`](api-parser-regex.md) -- [`@serialport/parser-slip-encoder`](api-parser-slip-encoder.md) +- [@serialport/parser-byte-length](api-parser-byte-length.md) +- [@serialport/parser-cctalk](api-parser-cctalk.md) +- [@serialport/parser-delimiter](api-parser-delimiter.md) +- [@serialport/parser-readline](api-parser-readline.md) +- [@serialport/parser-ready](api-parser-ready.md) +- [@serialport/parser-regex](api-parser-regex.md) +- [@serialport/parser-slip-encoder](api-parser-slip-encoder.md) diff --git a/docs/api-parser-cctalk.md b/docs/api-parser-cctalk.md new file mode 100644 index 0000000..5290988 --- /dev/null +++ b/docs/api-parser-cctalk.md @@ -0,0 +1,18 @@ +--- +id: api-parser-cctalk +title: ccTalk Parser +--- +```js +new CCTalk() +``` +A transform stream that emits [ccTalk](https://en.wikipedia.org/wiki/CcTalk) packets as they are received. + +## Example +```js +const SerialPort = require('serialport') +const CCTalk = require('@serialport/parser-cctalk') +const port = new SerialPort('/dev/ttyUSB0') + +const parser = port.pipe(new CCtalk()) +parser.on('data', console.log) +``` diff --git a/docs/api-serialport.md b/docs/api-serialport.md index 227e58a..76a6094 100644 --- a/docs/api-serialport.md +++ b/docs/api-serialport.md @@ -1,6 +1,6 @@ --- id: api-serialport -title: SerialPort API +title: SerialPort --- ```js diff --git a/packages/stream/stream.js b/packages/stream/stream.js index c2b9e86..020519a 100644 --- a/packages/stream/stream.js +++ b/packages/stream/stream.js @@ -347,7 +347,7 @@ SerialPort.prototype._writev = function(data, callback) { */ /** - * Listening for the `data` event puts the port in flowing mode. Data is emitted as soon as it's received. Data is a `Buffer` object with a varying amount of data in it. The `readLine` parser converts the data into string lines. See the [parsers](https://node-serialport.github.io/node-serialport/global.html#Parsers) section for more information on parsers, and the [Node.js stream documentation](https://nodejs.org/api/stream.html#stream_event_data) for more information on the data event. + * Listening for the `data` event puts the port in flowing mode. Data is emitted as soon as it's received. Data is a `Buffer` object with a varying amount of data in it. The `readLine` parser converts the data into string lines. See the [parsers](https://serialport.io/docs/api-parsers-overview) section for more information on parsers, and the [Node.js stream documentation](https://nodejs.org/api/stream.html#stream_event_data) for more information on the data event. * @event data */ diff --git a/packages/website/core/Footer.js b/packages/website/core/Footer.js index ed9b83f..ff8857e 100644 --- a/packages/website/core/Footer.js +++ b/packages/website/core/Footer.js @@ -71,17 +71,17 @@ class Footer extends React.Component {