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-nodeUsage
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);