Skip to content
This repository has been archived by the owner on Jul 2, 2022. It is now read-only.

janet-lang/path

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

path.janet

This module is has been moved into spork, and as such, this repository is no longer maintained. Please use spork/path instead.

Simple path manipulation module for Janet. Supports manipulation both windows and posix paths on any platform, and provides functions that work according to the current host platform.

All functions have three forms, under path, path/win, and path/posix. The prefix indicates which type of path the function manipulates.

(import path)

# Examples for a non-windows system, use path/win/ for windows and
# path/posix/ for posix.

(path/ext "my/long/path.txt") # -> ".txt"
path/sep # -> "/" on posix, "\\" on windows
path/delim # -> ":" on posix, ";" on windows
(path/basename "some/path.txt") # -> "path.txt"
(path/dirname "some/path.txt") # -> "some/"
(path/parts "some/path/file.txt") # -> ["some" "path" "file.txt"]
(path/normalize "some/.././thing/file.txt") # -> "thing/file.txt"
(path/join "some/path" "../thing/file.txt") # -> "some/thing/file.txt"
(path/abspath? "/home/blah") # -> true
(path/abspath "file.txt") # -> "/home/me/cwd/file.txt"

Installation

[sudo] jpm install https://github.com/janet-lang/path.git

License

Licensed under the MIT License. See LICENSE for details.

About

Path manipulation library for Janet

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages