electron-evaluate
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

electron-evaluate Travis CI Build Status

Evaluate some code in an Electron context.

NPM Badge

Install

npm install electron-evaluate

Usage

const electronEvaluate = require("electron-evaluate")
 
const result = await electronEvaluate(async () => {
    // You can use Electron APIs here
})

API

electronEvaluate(function_, arguments_, options)

Returns a cancelable promise which resolves with the return value of function_. To cancel it, use .cancel() on the return value.

function_

Type: (...arguments_) => any | Promise<any>

The function to evaluate in the Electron context.

arguments_

Type: any[]

An array of arguments to include as arguments when calling function_.

options

Type: object

Options to pass to new BrowserWindow().

Package Sidebar

Install

npm i electron-evaluate

Weekly Downloads

3

Version

1.0.0

License

MIT

Unpacked Size

4.89 kB

Total Files

6

Last publish

Collaborators

  • richienb