JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 5
  • Score
    100M100P100Q22547F
  • License Zlib

A Node.js native addon for file dialogs using tinyfiledialogs.

Package Exports

  • tinyfiledialogs-node

Readme

tinyfiledialogs-node

A simple Node.js wrapper for tinyfiledialogs, providing cross-platform file dialogs with minimal dependencies.

Installation

npm install tinyfiledialogs-node

Usage

const { popup, pickFile, pickFolder, inputBox, saveFileDialog } = require('tinyfiledialogs-node');

Functions

popup(title: string, message: string): void

Displays a simple message popup.

popup('Hello', 'This is a message');

pickFile(filters?: string[], allowMultiple?: boolean): string[]

Opens a file picker dialog and returns an array of selected file paths.

const files = pickFile(['png', 'jpg'], true);
console.log(files);

pickFolder(defaultPath?: string): string | null

Opens a folder picker dialog and returns the selected folder path.

const folder = pickFolder();
console.log(folder);

inputBox(title: string, message: string, defaultInput?: string): string | null

Displays an input box for user text input.

const name = inputBox('Enter Name', 'What is your name?', 'John Doe');
console.log(name);

saveFileDialog(filter?: string): string | null

Opens a save file dialog with an optional file type filter.

const filePath = saveFileDialog('*.txt');
console.log(filePath);