Pax.Util.Assets (Pax v0.0.1-dev.20251023)
View SourceSummary
Functions
Includes the contents of the file at the given path.
Reads the contents of the file at the given path.
Reads a JSON cache manifest from the given path.
Stats the file at the given path.
Functions
Includes the contents of the file at the given path.
The contents are wrapped in comments indicating the start and end of the included content. Source map URLs are also disabled by commenting them out.
This is useful for embedding assets into a single file while retaining some level of traceability.
Reads the contents of the file at the given path.
If the file cannot be read, logs an error and returns an empty string.
Reads a JSON cache manifest from the given path.
If the file cannot be read, returns an empty map. If a key is given, returns the value
associated with that key in the manifest, or an empty map if the key does not exist. Example: "latest".
Stats the file at the given path.
If the file cannot be read, logs an error and returns a %File.Stat{} with 0 size and times set to now.