path
import { path } from "@tynd/core/client";Small synchronous path utilities built on pathe. navigator.platform picks the Windows or POSIX flavour. No round-trip to Rust — these run entirely in the WebView / JS runtime.
join(...parts: string[]): string
Section titled “join(...parts: string[]): string”Joins path segments and normalizes the result. The output always uses /, on Windows too (pathe behaviour); Windows APIs accept it.
path.join("/tmp", "notes", "hello.md"); // "/tmp/notes/hello.md"path.join("C:\\", "Users", "me"); // "C:/Users/me" on WindowsEmpty strings are ignored.
dirname(p: string): string
Section titled “dirname(p: string): string”Parent directory of the path.
path.dirname("/tmp/notes/hello.md"); // "/tmp/notes"path.dirname("/tmp"); // "/"path.dirname("hello.md"); // ""basename(p: string, ext?: string): string
Section titled “basename(p: string, ext?: string): string”Last segment, optionally with an extension stripped.
path.basename("/tmp/notes/hello.md"); // "hello.md"path.basename("/tmp/notes/hello.md", ".md"); // "hello"extname(p: string): string
Section titled “extname(p: string): string”File extension including the leading dot, or "" if none.
path.extname("hello.md"); // ".md"path.extname("Makefile"); // ""- Always
/. Paths these helpers build use/on every OS; inputs may use/or\. There is nosep(): split on/[/\]/if you need segments. - Synchronous. These functions do not return promises — they run in the WebView.
- No
resolve(),normalize(), orisAbsolute()— compose them yourself or useURL/ framework helpers if you need them. - Absolute paths are produced by joining from a known root (
await os.appDataDir(), etc.) — not by aresolvefunction.