LogoPear Docs
ReferencesBareModules

bare-sidecar

Reference for bare-sidecar: start and manage a Bare sidecar process from a Node.js or Electron host.

bare-sidecar starts and manages a Bare sidecar process from a Node.js or Electron host—a way to run a Bare core alongside a Node/Electron app and talk to it over its standard streams. It's pure JavaScript.

npm i bare-sidecar

Usage

const Sidecar = require('bare-sidecar')

const sidecar = new Sidecar(require.resolve('./entry'))

sidecar
  .on('data', (data) => { /* output from the sidecar */ })
  .on('exit', (code, status) => { /* the sidecar exited */ })

API

const sidecar = new Sidecar(entry[, args][, options])

Spawn a Bare process running entry, with optional args and options.

sidecar.stdin · sidecar.stdout · sidecar.stderr

The sidecar's standard streams.

Emits data (sidecar output), exit ((code, status)), and close.

Builds on bare-subprocess, bare-pipe, bare-module, bare-fs, bare-os, bare-path, bare-stream, and bare-url (see Bare modules).

See also

On this page