{"id":21511439,"url":"https://github.com/ayangweb/tauri-plugin-fs-pro","last_synced_at":"2025-04-09T17:52:15.762Z","repository":{"id":264318892,"uuid":"893049861","full_name":"ayangweb/tauri-plugin-fs-pro","owner":"ayangweb","description":"Extended with additional methods for files and directories.","archived":false,"fork":false,"pushed_at":"2025-03-23T13:31:20.000Z","size":421,"stargazers_count":12,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-02T09:11:29.207Z","etag":null,"topics":["tauri","tauri-plugin"],"latest_commit_sha":null,"homepage":"https://crates.io/crates/tauri-plugin-fs-pro","language":"Rust","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/ayangweb.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":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-11-23T12:01:22.000Z","updated_at":"2025-03-22T00:15:59.000Z","dependencies_parsed_at":null,"dependency_job_id":"1956fad4-b04f-4021-9524-1403ebe21d11","html_url":"https://github.com/ayangweb/tauri-plugin-fs-pro","commit_stats":{"total_commits":14,"total_committers":1,"mean_commits":14.0,"dds":0.0,"last_synced_commit":"0aadc6b28031d8f87e0ee4e8ad610872b4e33836"},"previous_names":["ayangweb/tauri-plugin-fs-pro"],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ayangweb%2Ftauri-plugin-fs-pro","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ayangweb%2Ftauri-plugin-fs-pro/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ayangweb%2Ftauri-plugin-fs-pro/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ayangweb%2Ftauri-plugin-fs-pro/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ayangweb","download_url":"https://codeload.github.com/ayangweb/tauri-plugin-fs-pro/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248083267,"owners_count":21045070,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["tauri","tauri-plugin"],"created_at":"2024-11-23T22:08:55.029Z","updated_at":"2025-04-09T17:52:15.755Z","avatar_url":"https://github.com/ayangweb.png","language":"Rust","funding_links":[],"categories":["Development"],"sub_categories":["Plugins"],"readme":"# tauri-plugin-fs-pro\n\n\u003e This plugin only works on tauri v2, if you need the v1 plugin, feel free to submit a PR!\n\n**What is the difference with `@tauri-apps/plugin-fs`?**\n\nThe `stat` method of `@tauri-apps/plugin-fs` supports only files when getting size, while the `metadata` method of `tauri-plugin-fs-pro` supports both files and directories when getting size. And some additional [methods](#methods) are provided. More methods will be expanded in the future.\n\nhttps://github.com/user-attachments/assets/33dff210-9962-4d73-9648-5227d8fd9519\n\n## Platform Support\n\n| Platform | Supported |\n| -------- | --------- |\n| Windows  | ✅        |\n| macOS    | ✅        |\n| Linux    | ✅        |\n| Android  | ❌        |\n| iOS      | ❌        |\n\n## Install\n\n```shell\ncargo add tauri-plugin-fs-pro\n```\n\nYou can install the JavaScript Guest bindings using your preferred JavaScript package manager:\n\n```shell\npnpm add tauri-plugin-fs-pro-api\n```\n\n## Usage\n\n`src-tauri/src/lib.rs`\n\n```diff\npub fn run() {\n    tauri::Builder::default()\n+       .plugin(tauri_plugin_fs_pro::init())\n        .run(tauri::generate_context!())\n        .expect(\"error while running tauri application\");\n}\n```\n\n`src-tauri/capabilities/default.json`\n\n```diff\n{\n    ...\n    \"permissions\": [\n        ...\n+       \"fs-pro:default\"\n    ]\n}\n```\n\nAfterwards all the plugin's APIs are available through the JavaScript guest bindings:\n\n```ts\nimport { isExist } from \"tauri-plugin-fs-pro-api\";\n\nconst exists = await isExist(\"/Users/xxx/EcoPaste.txt\");\nconsole.log(exists); // true\n```\n\n## Methods\n\n| Method       | Description                                                                               |\n| ------------ | ----------------------------------------------------------------------------------------- |\n| `isExist`    | Whether the path exists.                                                                  |\n| `isDir`      | Whether the path is a directory.                                                          |\n| `isFile`     | Whether the path is a file.                                                               |\n| `size`       | Get the size of the path in bytes, or 0 if it does not exist.                             |\n| `name`       | Get the file or directory name of the path.                                               |\n| `fullName`   | Get the file or directory name of the path, including the extension name if it is a file. |\n| `extname`    | Get the extension name of the file.                                                       |\n| `icon`       | Get the system icon of the path.                                                          |\n| `metadata`   | Get the metadata of the path.                                                             |\n| `open`       | Open the path in file explorer or the default application.                                |\n| `compress`   | Compress the source path into a tar.gz file to the destination path.                      |\n| `decompress` | Decompress the tar.gz file from the source path to the destination path.                  |\n| `transfer`   | Move the source path to the destination path.                                             |\n\n## Example\n\n```shell\ngit clone https://github.com/ayangweb/tauri-plugin-fs-pro.git\n```\n\n```shell\npnpm install\n\npnpm build\n\ncd examples/tauri-app\n\npnpm install\n\npnpm tauri dev\n```\n\n## Thanks\n\n- Use [file_icon_provider](https://github.com/IohannRabeson/file_icon_provider) and [image](https://github.com/image-rs/image) to get the system icon for a path.\n\n- Use [open](https://github.com/Byron/open-rs) to open the path in default application.\n\n- Use [showfile](https://github.com/jf2048/showfile) to open the path in file explorer.\n\n- Use [flate2](https://github.com/rust-lang/flate2-rs) and [tar](https://github.com/alexcrichton/tar-rs) to compress and decompress tar.gz.\n\n- Use [fs_extra](https://github.com/webdesus/fs_extra) to implement the move path.\n\n## Who's Use It\n\n- [EcoPaste](https://github.com/EcoPasteHub/EcoPaste) - Open source cross-platform clipboard management tool.\n\n- [Coco AI](https://github.com/infinilabs/coco-app) - Search, Connect, Collaborate, Your Personal AI Search and Assistant, all in one space.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fayangweb%2Ftauri-plugin-fs-pro","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fayangweb%2Ftauri-plugin-fs-pro","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fayangweb%2Ftauri-plugin-fs-pro/lists"}