Skip to content
Effect 4.0 is here. One ecosystem. Zero dependencies.

Path

6 exports Since v1.0.0 Source

Layer

Since v1.0.0

An implementation of the Path interface that can be used in all environments (including browsers).

It uses the POSIX standard for paths.

Signature

declare const layer: Layer<Path>

Model

Path

interface
Since v1.0.0

Signature

interface Path {
readonly [TypeId]: typeof TypeId;
readonly basename: (path: string, suffix?: string) => string;
readonly dirname: (path: string) => string;
readonly extname: (path: string) => string;
readonly format: (pathObject: Partial<Path.Parsed>) => string;
readonly fromFileUrl: (url: URL) => Effect<string, BadArgument>;
readonly isAbsolute: (path: string) => boolean;
readonly join: (...paths: readonly Array<string>) => string;
readonly normalize: (path: string) => string;
readonly parse: (path: string) => Parsed;
readonly relative: (from: string, to: string) => string;
readonly resolve: (...pathSegments: readonly Array<string>) => string;
readonly sep: string;
readonly toFileUrl: (path: string) => Effect<URL, BadArgument>;
readonly toNamespacedPath: (path: string) => string;
}

Other

Since v1.0.0

Tag

Since v1.0.0

Signature

declare const Path: Tag<Path, Path>

Type Ids

Since v1.0.0

Signature

declare const TypeId: unique symbol
Since v1.0.0

Signature

type TypeId = typeof TypeId