Returns the last portion of a path. Trailing directory separators are ignored.
path
Optional
An optional file extension to be removed from the returned path.
import { basename } from '@tauri-apps/api/path';const base = await basename('path/to/app.conf');assert(base === 'app.conf'); Copy
import { basename } from '@tauri-apps/api/path';const base = await basename('path/to/app.conf');assert(base === 'app.conf');
1.0.0
Returns the last portion of a
path
. Trailing directory separators are ignored.