{"id":17043441,"url":"https://github.com/leavez/go-pathname","last_synced_at":"2025-03-23T02:23:05.515Z","repository":{"id":209159129,"uuid":"723310400","full_name":"leavez/go-pathname","owner":"leavez","description":null,"archived":false,"fork":false,"pushed_at":"2023-11-25T15:36:41.000Z","size":10,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-28T05:27:16.520Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/leavez.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-11-25T09:00:58.000Z","updated_at":"2023-11-25T13:18:23.000Z","dependencies_parsed_at":"2023-11-25T14:26:14.303Z","dependency_job_id":"35c5c96f-95c8-41b0-bbdd-8f4fe7525422","html_url":"https://github.com/leavez/go-pathname","commit_stats":null,"previous_names":["leavez/go-pathname"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leavez%2Fgo-pathname","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leavez%2Fgo-pathname/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leavez%2Fgo-pathname/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leavez%2Fgo-pathname/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/leavez","download_url":"https://codeload.github.com/leavez/go-pathname/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245045605,"owners_count":20552063,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-14T09:29:32.533Z","updated_at":"2025-03-23T02:23:05.482Z","avatar_url":"https://github.com/leavez.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# go-pathname\n\nManaging paths conveniently. Inspired by ruby's `Pathname`. \n\n\n## TLDR\n\n```go\npath := pathname.New(p)\n\nif path.Exist() {\n\t// do something\n}\n\npath.Append(\"abc.txt\").AbsolutePath()\npath.Children()\n\n// ...\n```\n\n### Methods\n\n```\nNew(pathString string) Pathname\nRaw(pathString string) Pathname\n(Pathname) String() string\n(Pathname) Append(path string) Pathname\n(Pathname) Parent() Pathname\n(Pathname) Basename() string\n(Pathname) Extension() string\n(Pathname) IsAbsolute() bool\n(Pathname) AbsolutePath() Pathname\n(Pathname) Children() ([]Pathname, error)\n(Pathname) Walk(block func(path Pathname, entry fs.DirEntry, err error) error) error\n(Pathname) ChildrenNames() ([]string, error)\n(Pathname) Mkpath() error\n(Pathname) Rmtree() error\n(Pathname) Glob(pattern string) []Pathname\n(Pathname) AppendRandom() Pathname\n(Pathname) Exist() bool\n(Pathname) IsDirectory() bool\n(Pathname) IsFile() bool\n(Pathname) IsRegularFile() bool\n(Pathname) IsSymlink() bool\n(Pathname) Write(text string) error\n(Pathname) Read() (string, error)\n(Pathname) MoveTo(path Pathname) error\n(Pathname) CopyTo(toPath Pathname) error\n(Pathname) CopyFileTo(toPath Pathname) error\n(Pathname) SymlinkTo(toPath Pathname) error\n(Pathname) Perm() uint32\n(Pathname) Chmod(perm uint32) error\n(Pathname) Chown(uid int) error\nCurrent() Pathname\nTempDir() Pathname\nHomeDir() Pathname\n(Pathname) Chdir() error\n(Pathname) ChdirWithin(block func(path Pathname)) error\nErrIgnore[T any](a T, err error) T\nErrDie[T any](a T, err error) T\n```\n\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleavez%2Fgo-pathname","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fleavez%2Fgo-pathname","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleavez%2Fgo-pathname/lists"}