Skip to content

Liatir Node bridge

The Liatir object passed to .main(...) is the Node plugin bridge. It connects the plugin process to the running Liatir desktop app through local IPC.

ts
export default liatirPlugin.main(async ({ input, Liatir }: PluginContext<typeof liatirPlugin>) => {
  const node = await Liatir.deps.check("node");

  return {
    available: node.available,
  };
});

Available areas

AreaUse it for
Liatir.jobsSpawn, wait for, stream, and inspect local processes.
Liatir.depsCheck whether command-line binaries are available.
Liatir.desktop.fsScoped Liatir storage.
Liatir.desktop.filesNative file dialogs when appropriate.
Liatir.desktop.eventsApp event bridge.
Liatir.desktop.appApp information.
Liatir.desktop.networkNetwork status and simple diagnostics.
Liatir.desktop.clipboardClipboard access.
Liatir.desktop.notificationsNative notifications.
Liatir.desktop.diagnosticsDiagnostic helpers.
Liatir.desktop.globalVariablesShared string variables.
Liatir.alignTyped alignment helpers.
Liatir.qcTyped quality-control helpers.
Liatir.variantsTyped variant-analysis helpers.
Liatir.pluginsLow-level WASM plugin runtime.
Liatir.sidecarRegistered sidecar binaries.
Liatir.pipelineChain WASM and sidecar steps into a sequential pipeline.
Liatir.paths()App filesystem paths.
Liatir.invokeLow-level IPC escape hatch.

GUI-only browser/webview areas such as window controls, menu integration, shortcuts, badge, autostart, and context menu are intentionally not part of the Node plugin bridge.

Running a command

ts
const stdoutLines: string[] = [];
const stderrLines: string[] = [];

const job = await Liatir.jobs.run("seqkit", ["stats", input.fastq], {
  onStdout: (line) => stdoutLines.push(line),
  onStderr: (line) => stderrLines.push(line),
});

return {
  status: job.status.type,
  stdout: stdoutLines.join("\n"),
  stderr: stderrLines.join("\n"),
};

Use Liatir.deps.check(...) first if the plugin depends on a local binary that may not be installed.

Liatir — powerful bioinformatics on your machine.

By using this app, you agree to our Privacy Policy and Terms of Service.