JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 3
  • Score
    100M100P100Q25303F
  • License MIT

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

Package Exports

  • tinyfiledialogs-node
  • tinyfiledialogs-node/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (tinyfiledialogs-node) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

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

License

This project is licensed under the MIT License.