pl2303

0.1.0 • Public • Published

pl2303

Prolific PL2303 user-space USB to serial adapter driver for Node.js

Usage

const pl2303 = require('pl2303');
const { webusb } = require('usb');

const opts = {
    baudRate : 115200
};

(async () => {
    const device = await webusb.requestDevice({
        filters: [
        {
            vendorId: 1659,
            productId: 8963,
        },
        ],
    });

    let serial = new pl2303(device, opts);

    serial.on('data', data => console.log(data));
    serial.on('ready', () => serial.send(new Buffer('Hello!')));
})().catch((error) => {
    console.log('Error: ', error);
});

Readme

Keywords

none

Package Sidebar

Install

npm i pl2303

Weekly Downloads

68

Version

0.1.0

License

MIT

Unpacked Size

6.97 kB

Total Files

6

Last publish

Collaborators

  • gniezen