| Tauri frontend | apps//src//.ts, apps//src//.svelte | @tauri-apps/api/path | | Node.js/Bun backend | packages//.ts, CLI tools | Node.js path module |
Rule: If the code runs in the browser (Tauri webview), use Tauri's path APIs. If it runs in Node.js/Bun, use the Node.js path module.
| join(...paths) | Join path segments with platform separator | await join(baseDir, 'workspaces', id) | | dirname(path) | Get parent directory | await dirname('/foo/bar/file.txt') → /foo/bar | | basename(path, ext?) | Get filename, optionally strip extension | await basename('/foo/bar.txt', '.txt') → bar |
Gestione del percorso Tauri, operazioni sui file multipiattaforma e utilizzo dell'API. Da utilizzare quando si lavora con percorsi di file nel codice frontend Tauri, si accede alle API del file system o si gestiscono le differenze di piattaforma nelle app desktop. Fonte: epicenterhq/epicenter.