New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

headless-electron

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

headless-electron

Manage a headless instance of Electron to run logic in tests and on the server

  • 0.7.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4K
decreased by-16.46%
Maintainers
1
Weekly downloads
 
Created
Source

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

Keywords

FAQs

Package last updated on 28 Mar 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc