UNPKG

comportc

Version:

Allow you read and write a Serial Port

40 lines (26 loc) 756 B
# ComPortC Allow you read and write in a Serial Port. ## Installation Use the package manager [npm](https://www.npmjs.com/) or [yarn](https://yarnpkg.com/) to install ComPortC. ```bash yarn add comportc ``` ```bash npm install comportc ``` ## Usage ```javascript const Serial = require("comportc"); //Open communication Serial.Open(4, 9600); //blocks the execution until the data being recept const readed = Serial.ReadSync(); console.log(readed) // write the first params in port 4 Serial.Write("hello"); // close comunnication opened before Serial.Close(); ``` ## Contributing Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change. Please make sure to update tests as appropriate.