1.1.1 • Published 11 months ago

@eightnineight/electron-dialog v1.1.1

Weekly downloads
-
License
MIT
Repository
github
Last release
11 months ago

electron-dialog

Use main process dialogs in renderer process

Install

npm install @eightnineight/electron-dialog

Usage

main process

import "@eightnineight/electron-dialog";

renderer process

import { showOpenDialog, showSaveDialog, showMessageBox, showErrorBox } from "@eightnineight/electron-dialog";

let file;

// the parameters are the same as those in the original electron showOpenDialog()
file = await showOpenDialog({
    title: "Open File",
    buttonLabel: "Open",
});
if (!file.canceled) {
    console.log("open:", file.filePath);
}

// the parameters are the same as those in the original electron showSaveDialog()
file = await showSaveDialog({
    title: "Save File",
    buttonLabel: "Save",
});
if (!file.canceled) {
    console.log("save:", file.filePath);
}

// the parameters are the same as those in the original electron showMessageBox()
showMessageBox({
    type: "info",
    title: "Message",
    message: "Message Box",
});

// the parameters are the same as those in the original electron showErrorBox()
showErrorBox({
    title: "Error",
    content: "Unknown",
});
1.1.1

11 months ago

1.1.0

11 months ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago