Skip to content

dirname

Import from @varavel/vdl-plugin-sdk/utils/paths.

function dirname(path): string;

Returns the parent directory portion of a path.

Parameters

Parameter Type Description
path string Path to inspect.

Returns

string

The directory name portion of path.

Example

dirname("generated/models/user.ts");
// returns "generated/models"

See

Powered by pathe (MIT License): https://github.com/unjs/pathe