Socket
Book a DemoInstallSign in
Socket

cocoa-dialog

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cocoa-dialog

Display common GUI dialogs on macOS using cocoaDialog

latest
Source
npmnpm
Version
3.0.0
Version published
Maintainers
1
Created
Source

cocoa-dialog

Display common GUI dialogs on macOS using cocoaDialog

Issues regarding the GUI should be opened on the cocoaDialog issue tracker.

Install

npm install cocoa-dialog

Usage

import cocoaDialog from 'cocoa-dialog';

const result = await cocoaDialog('msgbox', {
	title: 'Unicorn',
	icon: 'favorite',
	text: 'What do you want?',
	button1: 'Gimme rainbow',
	button2: 'Magicalifify'
});

if (result === '1') {
	console.log('button1 clicked');
} else if (result === '2') {
	console.log('button2 clicked');
}

API

cocoaDialog(type, options)

Returns a Promise for result and resolves when the dialog is dismissed.

type

Type: string
Values:

  • bubble
  • msgbox
  • ok-msgbox
  • yesno-msgbox
  • inputbox
  • standard-inputbox
  • secure-inputbox
  • secure-standard-inputbox
  • fileselect
  • filesave
  • textbox
  • progressbar
  • dropdown
  • standard-dropdown

See the cocoaDialog docs.

options

Type: object

Any of the options defined in the cocoaDialog docs can be used in a camel-cased form.

For example, ‑‑informative‑text should be informativeText: true.

Keywords

cocoadialog

FAQs

Package last updated on 13 Oct 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts