JavaScript / Node.js
import { execFileSync } from 'node:child_process';
const request = {
op: 'redact', language: 'en', text: 'Contact alice@example.com',
};
const output = execFileSync(process.argv[2], [], {
input: JSON.stringify(request) + '\n',
encoding: 'utf8',
});
const response = JSON.parse(output);
if (!response.ok) throw new Error(response.reason);
console.log(response.text); // Contact [EMAIL_1]
Call the JSONL subprocess interface with Node’s standard library; the Nix-built executable uses compiled model and runtime defaults.
nix build
PREFIX=$(cd result && pwd -P)
node examples/node.mjs "$PREFIX/bin/defingerprinter"