path

package
v0.13.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 19, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package path provides Node.js path module equivalents for transpiled TypeScript code.

Index

Constants

This section is empty.

Variables

Delimiter is the OS-specific path list delimiter.

Sep is the OS-specific path separator.

Functions

func Basename

func Basename(p string, ext ...string) string

Basename returns the last element of a path, optionally stripping an extension.

func Dirname

func Dirname(p string) string

Dirname returns the directory of a path.

func Extname

func Extname(p string) string

Extname returns the file extension.

func IsAbsolute

func IsAbsolute(p string) bool

IsAbsolute returns true if the path is absolute.

func Join

func Join(parts ...string) string

Join joins path segments.

func Normalize

func Normalize(p string) string

Normalize normalizes a path.

func Relative

func Relative(from, to string) (string, error)

Relative returns a relative path from 'from' to 'to'.

func Resolve

func Resolve(parts ...string) string

Resolve resolves a sequence of paths to an absolute path.

Types

type ParsedPath

type ParsedPath struct {
	Root string
	Dir  string
	Base string
	Ext  string
	Name string
}

Parse parses a path into components.

func Parse

func Parse(p string) ParsedPath

Parse splits a path into its components.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL