0.9.13 • Published 2 years ago

electron-prompts v0.9.13

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
2 years ago

electron-prompts

NPM Version NPM Type Definitions Docs

An easy tool for creating interactive prompts from the Electron main process

Logo

Installation

npm install electron-prompts

Usage

Import and instantiate a PromptManager for your project:

import PromptManager from "electron-prompts"

const prompts = new PromptManager()

Create and spawn GUI prompts using simple Prompt Templates:

const pTemplate = {
	windowTitle: "electron-prompts",
	cancelButton: {
		classes: ["btn", "btn-secondary"]
	},
	elements: [
		{
			type: "header",
			value: "Enter test value",
		},
		{
			type: "paragraph",
			value: "This is an easy user-input prompt made with electron-prompts:",
		},
		{
			type: "input",
			name: "testValue",
			placeholder: "Test input",
			value: "I am the default value",
			classes: ["form-control"],
		},
	],
	buttons: [
		{
			name: "submit",
			value: "Save Changes",
			classes: ["btn", "btn-primary"],
		},
	],
}

const result = await prompts.spawn(pTemplate)

Further documentation available here.

0.9.13

2 years ago

0.9.12

2 years ago

0.9.11

2 years ago

0.9.9

2 years ago

0.9.10

2 years ago

0.9.8

2 years ago

0.9.7

2 years ago

0.9.6

2 years ago

0.9.3

2 years ago

0.9.5

2 years ago

0.9.2

2 years ago

0.9.1

2 years ago

0.9.0

2 years ago