https://github.com/cocoadialog/node-cocoadialog
Node.js wrapper for cocoaDialog
https://github.com/cocoadialog/node-cocoadialog
cocoadialog dialogs macos node-wrapper nodejs osx utility
Last synced: 7 months ago
JSON representation
Node.js wrapper for cocoaDialog
- Host: GitHub
- URL: https://github.com/cocoadialog/node-cocoadialog
- Owner: cocoadialog
- License: mit
- Created: 2017-03-26T13:22:39.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2018-06-29T22:45:15.000Z (over 7 years ago)
- Last Synced: 2025-06-03T21:14:55.558Z (7 months ago)
- Topics: cocoadialog, dialogs, macos, node-wrapper, nodejs, osx, utility
- Language: JavaScript
- Homepage: https://unicorn-fail.github.io/node-cocoadialog
- Size: 1.88 MB
- Stars: 7
- Watchers: 4
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# cocoadialog
> Node.js wrapper for [cocoaDialog]
**Note:** Issues with the actual cocoaDialog application should be filed in its [issue queue](https://github.com/mstratman/cocoadialog/issues).
## Install
```
$ npm install --save cocoadialog
```
## Basic Usage
```js
const cocoaDialog = require('cocoadialog').setGlobalOption({
stringOutput: true
});
cocoaDialog.msgBox()
.setTitle('This is the title')
.setIcon('caution')
.setLabel('This is the label')
.setButtons('Ok', 'Cancel', 'More')
.open()
.then(result => {
if (result.button === 'Ok') {
console.log('Ok button was clicked.');
}
else if (result.button === 'More') {
console.log('More button was clicked.');
}
})
.catch(result => {
if (result.hasAborted()) {
console.log('Cancel button was clicked.');
}
else {
console.error(result.error);
}
});
```
## Examples
* [MsgBox](https://unicorn-fail.github.io/node-cocoadialog/?content=msgbox)
* [ProgressBar](https://unicorn-fail.github.io/node-cocoadialog//?content=progressbar)
## API
[API Documentation](https://unicorn-fail.github.io/node-cocoadialog/?api)
## License
MIT © [Mark Carver](https://github.com/markcarver)
[cocoaDialog]: http://mstratman.github.io/cocoadialog/#documentation3.0