headless-electron
Run scripts from node in an Electron pool
![npm](https://img.shields.io/npm/dm/headless-electron.svg)
Usage
const ep = new ElectronProcess();
const result = await ep.runScript({
pathname: path.resolve(__dirname, "typescript.ts"),
functionName: "multiply",
args: [2, 3],
});
await ep.kill();
API
interface ElectronProcess {
constructor(options: {
debugMode: boolean; // true will show the Electron BrowserWindow for debugging purposes
concurrency: number; // maximum number of Electron BrowserWindows to create for parallel runs
});
runScript(options: {
pathname: string;
functionName?: string;
args?: any[];
}): Promise<any>;
}
Acknowledgements
Based on jest-electron
License
MIT