Skip to main content Link Search Menu Expand Document (external link)

Path overview

Added in v1.0.0


Table of contents


layer

layer

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

It uses the POSIX standard for paths.

Signature

export declare const layer: Layer<Path>

Added in v1.0.0

model

Path (interface)

Signature

export interface Path {
  readonly [TypeId]: TypeId
  readonly sep: string
  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: ReadonlyArray<string>) => string
  readonly normalize: (path: string) => string
  readonly parse: (path: string) => Path.Parsed
  readonly relative: (from: string, to: string) => string
  readonly resolve: (...pathSegments: ReadonlyArray<string>) => string
  readonly toFileUrl: (path: string) => Effect<URL, BadArgument>
  readonly toNamespacedPath: (path: string) => string
}

Added in v1.0.0

tag

Path

Signature

export declare const Path: Tag<Path, Path>

Added in v1.0.0

type ids

TypeId

Signature

export declare const TypeId: typeof TypeId

Added in v1.0.0

TypeId (type alias)

Signature

export type TypeId = typeof TypeId

Added in v1.0.0

utils

Path (namespace)

Added in v1.0.0

Parsed (interface)

Signature

export interface Parsed {
  readonly root: string
  readonly dir: string
  readonly base: string
  readonly ext: string
  readonly name: string
}

Added in v1.0.0