luau-path + @lune/fs and some utilities
- Add
pathfs.writeFileAll
- Includes typed
luau-path
utility (now fully typed) - @lune/fs library but supports path objects (
AsPath
objects which include string andPath
objects) - Does not require
node
&npm
anymore (now dependencyluau_path
is published to pesde!) - Includes runtime type checkers via greentea.
- Features useful path and fs related utilities (such as
watchFile
,Directory
,diff
and more!)
Install via pesde
pesde add jiwonz/pathfs -t lune
local pathfs = require("../lune_packages/pathfs")
local fs = pathfs.fs -- compat with lune's fs lib (@lune/fs)
fs.writeFile("something.json", "{ \"message\": \"Hello, world!\" }")
-- Using Path
local Path = pathfs.Path
local path = Path.from("something.json")
print(fs.readFile(path))
-- Some useful utilities
pathfs.script()
pathfs.absolute("relative/file/path")
pathfs.withoutCurDir("./to/remove/curdir/the/dot")
pathfs.diff("target", "base")
pathfs.findFile("path/to/file")
pathfs.findDir("path/to/dir")
pathfs.watchFile("path/to/file", function()
print("changed")
end)
pathfs.watchDirectories({ "dir1", "dir2" }, function()
print("changed")
end)
pathfs.watchEntryAdded("path/to/dir", function(addedEntry)
print("added:", addedEntry)
end)
pathfs.watchEntryRemoved("path/to/dir", function(removedEntry)
print("removed:", removedEntry)
end)
pathfs.watchDescendantEntryAdded("path/to/dir", function(addedEntry)
print("added", addedEntry)
end)
pathfs.watchDescendantEntryRemoved("path/to/dir", function(removedEntry)
print("removed", removedEntry)
end)
pathfs.writeFileAll("a/b/c/d/lol", "hi")
- seaofvoices/luau-path - The base of this library and cool Path implementation for Luau
- ffrostfall/lunePackages - watch utilities base implementations
- Generate markdown docs from Moonwave comments for pesde docs
- Add utils tests
- Write CHANGELOG.md instead writing in README.md (maybe from v0.6.0)