Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

nw-dialog

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nw-dialog

Node Webkit Dialog

  • 1.0.7
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
7
decreased by-12.5%
Maintainers
1
Weekly downloads
 
Created
Source

nw-dialog

File and Folder dialog for NWJS and Node Webkit

Installation

Use Node mode

npm install nw-dialog -S

var dialog = require('nw-dialog')
dialog.setContext(document) // work in client
dialog.openFileDialog( ... )

Use Client mode

<script src="nw-dialog/index.js"></script>
nw.Dialog.openFileDialog( ... ) 
// or
window.dialog.openFileDialog( ... )

Example

OpenFileDialog

Simple

dialog.openFileDialog(function(result) {
    alert(result)
})

With file type

dialog.openFileDialog('.zip,.rar', function(result) {
    alert(result)
})

or

dialog.openFileDialog(['.zip', '.rar'], function(result) {
    alert(result)
})

Multiple select

dialog.openFileDialog(true, function(result) {
    alert(result)
})

File type + Multiple select

dialog.openFileDialog('.zip,.rar', true, function(result) {
    alert(result)
})

File type + Working directory

dialog.openFileDialog('.zip,.rar', '/Users/didanurwanda', function(result) {
	alert(result)
})

File type + Multiple select + Working directory

dialog.openFileDialog('.zip,.rar', true, '/Users/didanurwanda', function(result) {
	alert(result)
})

SaveFileDialog

Simple

dialog.saveFileDialog(function(result) {
    alert(result)
})

File name

dialog.saveFileDialog('name.txt', function(result) {
    alert(result)
})

With extension

dialog.saveFileDialog('name', '.txt,.srt', function(result) {
    alert(result)
})

or

dialog.saveFileDialog('name', ['.txt', '.srt'], function(result) {
    alert(result)
})

Working directory

dialog.saveFileDialog('name', '.txt', '/Users/didanurwanda', function(result) {
    alert(result)
})

FolderBrowserDialog

Simple

dialog.folderBrowserDialog(function(result) {
    alert(result)
})

Default Directory

dialog.folderBrowserDialog('/Users/didanurwanda', function(result) {
    alert(result)
})

Keywords

FAQs

Package last updated on 16 Mar 2016

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc