Skip to content
/ ppath Public

A robust and expressive suite of utilities for handling file system paths with ease

License

Notifications You must be signed in to change notification settings

maa3x/ppath

Repository files navigation

Path Utility Library

This Go library provides a robust and expressive suite of utilities for handling file system paths with ease. Building on the standard path/filepath package, it introduces a set of intuitive, chainable methods that simplify file and directory operations such as path manipulation, pattern matching, directory traversal, and more. With this library, developers can effortlessly perform common file operations in a clean, readable style, making it ideal for projects that require efficient and flexible file system interactions.

Installation

To install the library, use go get:

go get github.com/maa3x/ppath

Usage

Here is a quick example of how to use the library:

package main

import (
  "fmt"
  "log"

  "github.com/maa3x/ppath"
)

func main() {
  p := path.New("/Users/matrix/Code/go/projects")
  p = p.Join("path", "README.md")

  if !p.IsExist() {
    log.Fatal("README.md not found!")
  }

  p2 := p.NthParent(2).Join("clone")
  if err := p.Dir().Copy(p2); err != nil {
    log.Fatal(err)
  }
}

About

A robust and expressive suite of utilities for handling file system paths with ease

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages