How to use @serialport/bindings - 2 common examples

To help you get started, we’ve selected a few @serialport/bindings 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 / list / lib / index.js View on Github external
}

const formatters = {
  text(ports) {
    ports.forEach(port => {
      console.log(`${port.path}\t${port.pnpId || ''}\t${port.manufacturer || ''}`)
    })
  },
  json(ports) {
    console.log(JSON.stringify(ports))
  },
  jsonl,
  jsonline: jsonl,
}

bindings.list().then(formatters[args.format], err => {
  console.error(JSON.stringify(err))
  process.exit(1)
})
github SignalK / signalk-server-node / src / serverroutes.js View on Github external
function listSerialPorts() {
    return serialBingings.list().then(ports => {
      return ports.map(port => port.comName)
    })
  }

@serialport/bindings

The bindings package has been renamed [`@serialport/bindings-cpp`](https://www.npmjs.com/package/@serialport/bindings-cpp) and it's code has been moved out of the monorepo to it's [own repository](https://github.com/serialport/bindings-cpp/).

MIT
Latest version published 3 years ago

Package Health Score

67 / 100
Full package analysis

Popular @serialport/bindings functions