1.0.0 • Published 3 years ago
electron-evaluate v1.0.0
electron-evaluate
Evaluate some code in an Electron context.
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()
.
1.0.0
3 years ago