1.0.0 • Published 3 years ago

electron-evaluate v1.0.0

Weekly downloads
1
License
MIT
Repository
github
Last release
3 years ago

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().