How to use @serialport/stream - 5 common examples

To help you get started, we’ve selected a few @serialport/stream examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github serialport / node-serialport / packages / terminal / lib / index.js View on Github external
// #!/usr/bin/env node
const { Select } = require('enquirer')
const args = require('commander')
const SerialPort = require('@serialport/stream')
const { version } = require('../package.json')
const { OutputTranslator } = require('./output-translator')
SerialPort.Binding = require('@serialport/bindings')

const makeNumber = input => Number(input)

args
  .version(version)
  .usage('[options]')
  .description('A basic terminal interface for communicating over a serial port. Pressing ctrl+c exits.')
  .option('-l --list', 'List available ports then exit')
  .option('-p, --path 
github serialport / node-serialport / packages / terminal / lib / index.js View on Github external
const listPorts = async () => {
  const ports = await SerialPort.list()
  for (const port of ports) {
    console.log(`${port.path}\t${port.pnpId || ''}\t${port.manufacturer || ''}`)
  }
}
github serialport / node-serialport / packages / serialport / lib / index.js View on Github external
const SerialPort = require('@serialport/stream')
const Binding = require('@serialport/bindings')
const parsers = require('./parsers')

/**
 * @type {AbstractBinding}
 */
SerialPort.Binding = Binding

/**
 * @type {Parsers}
 */
SerialPort.parsers = parsers

module.exports = SerialPort
github esrlabs / chipmunk / application / sandbox / serial / process / src / services / service.ports.ts View on Github external
public create(path: string) {
        const SerialPortNamespace = require('@serialport/stream');
        const MockBinding = require('@serialport/binding-mock');
        SerialPortNamespace.Binding = MockBinding;
        MockBinding.createPort(path, { echo: true, record: true });
    }
github serialport / node-serialport / packages / serialport / lib / index.js View on Github external
const SerialPort = require('@serialport/stream')
const Binding = require('@serialport/bindings')
const parsers = require('./parsers')

/**
 * @type {AbstractBinding}
 */
SerialPort.Binding = Binding

/**
 * @type {Parsers}
 */
SerialPort.parsers = parsers

module.exports = SerialPort

@serialport/stream

The serialport stream interface. This package requires bindings to work.

MIT
Latest version published 1 year ago

Package Health Score

81 / 100
Full package analysis

Similar packages