0.7.0 • Published 2 years ago

headless-electron v0.7.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

headless-electron

Run scripts from node in an Electron pool

Build Status npm npm

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; // full path to script to require
    functionName?: string; // function name to call, defaults to 'default'
    args?: any[]; // arguments passed to function
  }): Promise<any>; // returns what the function returns
}

Acknowledgements

Based on jest-electron

License

MIT

0.7.0

2 years ago

0.5.0

3 years ago

0.4.1

3 years ago

0.4.0

3 years ago

0.6.0

3 years ago

0.3.0

3 years ago

0.2.4

3 years ago

0.2.3

3 years ago

0.2.2

3 years ago

0.2.1

3 years ago

0.2.0

3 years ago

0.1.1

3 years ago

0.1.0

3 years ago