semtools 3.0.1

Semantic search and document parsing tools for the command line
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/usr/bin/env node
const { spawn } = require('node:child_process');
const { join } = require('node:path');
const { existsSync } = require('node:fs');

const isWindows = process.platform === 'win32';
const exe = isWindows ? '.exe' : '';
const localPath = join(__dirname, '..', 'dist', 'bin', `semtools${exe}`);

const bin = existsSync(localPath) ? localPath : `semtools${exe}`;

const child = spawn(bin, process.argv.slice(2), { stdio: 'inherit', shell: isWindows });
child.on('exit', (code, signal) => {
  if (signal) process.kill(process.pid, signal);
  process.exit(code ?? 1);
});