{"id":48823136,"url":"https://github.com/catharacta/nativefiledialog-for-bun","last_synced_at":"2026-04-14T16:02:05.112Z","repository":{"id":345305617,"uuid":"1185342943","full_name":"Catharacta/nativefiledialog-for-bun","owner":"Catharacta","description":"Cross-platform native file dialogs (Open, Save, Pick Folder) for Bun. Supports Windows, macOS, and Linux with FFI and script fallbacks.","archived":false,"fork":false,"pushed_at":"2026-03-18T14:45:57.000Z","size":36,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-19T04:49:28.720Z","etag":null,"topics":["bun","cross-platform","dialog","ffi","file","file-dialog","linux","macos","native-file-dialog","nfd-extended","typescript","windows"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Catharacta.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":"ROADMAP.md","authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-03-18T13:40:34.000Z","updated_at":"2026-03-18T14:46:36.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/Catharacta/nativefiledialog-for-bun","commit_stats":null,"previous_names":["catharacta/nativefiledialog-for-bun"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/Catharacta/nativefiledialog-for-bun","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Catharacta%2Fnativefiledialog-for-bun","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Catharacta%2Fnativefiledialog-for-bun/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Catharacta%2Fnativefiledialog-for-bun/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Catharacta%2Fnativefiledialog-for-bun/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Catharacta","download_url":"https://codeload.github.com/Catharacta/nativefiledialog-for-bun/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Catharacta%2Fnativefiledialog-for-bun/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31803790,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-14T11:13:53.975Z","status":"ssl_error","status_checked_at":"2026-04-14T11:13:53.299Z","response_time":153,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bun","cross-platform","dialog","ffi","file","file-dialog","linux","macos","native-file-dialog","nfd-extended","typescript","windows"],"created_at":"2026-04-14T16:01:54.459Z","updated_at":"2026-04-14T16:02:05.098Z","avatar_url":"https://github.com/Catharacta.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# nativefiledialog-for-bun\n\n[![CI](https://github.com/Catharacta/nativefiledialog-for-bun/actions/workflows/build-binaries.yml/badge.svg)](https://github.com/Catharacta/nativefiledialog-for-bun/actions/workflows/build-binaries.yml)\n[![npm version](https://img.shields.io/npm/v/nativefiledialog-for-bun.svg)](https://www.npmjs.com/package/nativefiledialog-for-bun)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\n**Cross-platform native file dialogs (Open, Save, Pick Folder) for Bun.**\n\nThis library provides a high-performance, Promise-based API for native file dialogs in Bun, using a hybrid approach of **FFI (Bun.dlopen)** and **Script Fallbacks (PowerShell, osascript, zenity)** to ensure maximum compatibility and speed.\n\n[日本語のREADMEはこちら](./README.ja.md)\n\n---\n\n## 🚀 Key Features\n\n-   **Auto-Download**: Automatically downloads pre-built binaries for your platform on installation.\n-   **High DPI Support**: Native Windows dialogs are now crisp and clear on 4K/high-resolution monitors (no more blurry UI).\n\n## 📦 Installation\n\n```bash\nbun install nativefiledialog-for-bun\n```\n\n## 💻 Usage\n\n```typescript\nimport * as nfd from \"nativefiledialog-for-bun\";\n\n// Open a single file\nconst file = await nfd.openFile({\n  defaultPath: \"./\",\n  filters: [{ name: \"Images\", extensions: [\"png\", \"jpg\"] }]\n});\nconsole.log(file); // \"/path/to/file.png\" or null if cancelled\n\n// Open multiple files\nconst files = await nfd.openFiles();\nconsole.log(files); // [\"/path/1.png\", \"/path/2.png\"] or null\n\n// Select a folder\nconst folder = await nfd.pickFolder();\nconsole.log(folder);\n\n// Select multiple folders\nconst folders = await nfd.pickFolders();\nconsole.log(folders);\n\n// Save a file\nconst savePath = await nfd.saveFile({\n  defaultName: \"data.json\",\n  filters: [{ name: \"JSON\", extensions: [\"json\"] }]\n});\n\nconst fileWithParent = await nfd.openFile({\n  parentWindow: windowHandle // number or bigint\n});\n\n// Custom Library Path (useful for bundled apps like ElectroBun)\n// Call this BEFORE any other nfd calls.\nnfd.setLibraryPath(\"/path/to/your/bin/directory\");\n```\n\n## 🛠 Platform Support\n\n| OS | FFI Backend | Script Fallback | pickFolders | parentWindow |\n| --- | --- | --- | --- | --- |\n| **Windows** | Win32 API (`nfd.dll`) | PowerShell | ✅ | ✅ (FFI) |\n| **macOS** | AppKit (`libnfd.dylib`) | AppleScript | ✅ | ✅ (FFI) |\n| **Linux** | GTK3 (`libnfd.so`) | Zenity | ✅ | ✅ (FFI) |\n\n\u003e [!NOTE]\n\u003e `parentWindow` support requires the FFI backend. Handlers passed to the script fallback will currently be ignored.\n\n## 📜 License\n\nThis wrapper library is released under the **MIT License**.\n\n### Third-party Acknowledgments\n\nThis project uses the [nativefiledialog-extended](https://github.com/btzy/nativefiledialog-extended) library for providing native dialog functionality.\n\n**nativefiledialog-extended License (zlib):**\n```text\nThis software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.\n\nPermission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:\n\n1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.\n2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.\n3. This notice may not be removed or altered from any source distribution.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcatharacta%2Fnativefiledialog-for-bun","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcatharacta%2Fnativefiledialog-for-bun","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcatharacta%2Fnativefiledialog-for-bun/lists"}