NekoCyan / node-win-dialog

Show dialog (windows)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

node-win-dialog

Install

Warning Windows only !!!

$ npm i node-win-dialog@latest

Screenshots

Screenshot

Usage

const Dialog = require('node-win-dialog');

const log = new Dialog();

log.showDialog('Hello wolrd', 'title');

log.showInputBox('Hello wolrd', 'title', 'default text')

log.showOpenFileDialog(false, 'title');

log.showFolderDialog('Description');

Properties

WinTools

See WinTools

Methods

showDialog

Param Type Optional Default Description
message ?string none Message to display
title ?string none Title of the dialog
type ?MessageTypeString DEFAULT Type of the dialog
button ?ButtonString DEFAULT Buttons of the dialog
defaultButton ?ButtonDefaultString DEFAULT Default button of the dialog
icon ?IconString DEFAULT Icon of the dialog

Return Promise<Response>

showInputBox

Param Type Optional Default Description
message ?string none Message to display
title ?string none Title of the dialog
defaultText ?string none Default text of the input box
xPos ?number none X position of the dialog
yPos ?number none Y position of the dialog

Return Promise<Response>

showOpenFileDialog

Param Type Optional Default Description
multiFile ?boolean none Allow multi select
title ?string Open Title of the dialog
...filterData ?Array<filterData> none File type filter

Return Promise<Response>

showFolderDialog

Param Type Optional Default Description
description ?string Please choose a folder. Description of the dialog

Return Promise<Response>

runAsAdmin

Param Type Optional Default Description
command string cmd.exe File / Application
args [?Array<string> none Command Arguments
workingDir ?string None Working Dir
showWindow ?WindowMode Show Window Mode

Return Promise<void>

Typedefs

Response

Types

Param Type
exitCode number
msgOut string
msgErr string
isError boolean
data ?ReturnButton or string or Array<string>

filterData

Types

Param Type
name string
ext string

WindowMode

  • Hide
  • Show
  • Minimize
  • Maximize

Types

ReturnButton

  • OK
  • CANCEL
  • YES
  • NO
  • ABORT
  • RETRY
  • IGNORE

Types

ButtonString

  • OK
  • OK_CANCEL
  • YES_NO
  • YES_NO_CANCEL
  • ABORT_RETRY_IGNORE
  • RETRY_CANCEL
  • DEFAULT

Types

IconString

  • NONE
  • ERROR
  • WARNING
  • INFORMATION
  • QUESTION

Types

ButtonDefaultString

  • FIRST
  • SECOND
  • THIRD
  • FOURTH
  • DEFAULT

Types

MessageTypeString

  • DEFAULT
  • APPLICATION
  • SYSTEM

Types

About

Show dialog (windows)

License:Apache License 2.0


Languages

Language:JavaScript 100.0%