The path delimiter: ':'
The path separator: '/'.
Return the last portion of a path. Similar to the Unix basename command. Often used to extract the file name from a fully qualified path.
the path to evaluate.
optionally, an extension to remove from the result.
Return the directory name of a path. Similar to the Unix dirname command.
the path to evaluate.
Return the extension of the path, from the last '.' to end of string in the last portion of the path. If there is no '.' in the last portion of the path or the first character of it is '.', then it returns an empty string
the path to evaluate.
Returns a path string from an object - the opposite of parse().
Determines whether {path} is an absolute path. An absolute path will always resolve to the same location, regardless of the working directory.
path to test.
Join all arguments together and normalize the resulting path. Arguments must be strings.
paths to join.
Normalize a string path, reducing '..' and '.' parts. When multiple slashes are found, they're replaced by a single one; when the path contains a trailing slash, it is preserved.
string path to normalize.
Returns an object from a path string - the opposite of format().
path to evaluate.
Returns a buffer that contains the data of the file at the specified path.
Returns a host binary that contains the data of the file at the specified path.
Solve the relative path from {from} to {to}. At times we have two absolute paths, and we need to derive the relative path from one to the other. This is actually the reverse transform of path.resolve.
The right-most parameter is considered {to}. Other parameters are considered an array of {from}.
Starting from leftmost {from} paramter, resolves {to} to an absolute path.
If {to} isn't already absolute, {from} arguments are prepended in right to left order, until an absolute path is found. If after using all {from} paths still no absolute path is found, the current working directory is used as well. The resulting path is normalized, and trailing slashes are removed unless the path gets resolved to the root directory.
string paths to join. Non-string arguments are ignored.
Generated using TypeDoc
Introduction
The
piweb.resources
module can be used to access files that are located in the extension package. The returned data can be used to initialize images, that can later be drawn to a drawing context, as shown in the example below:import * as piweb from 'piweb' piweb.events.on("render", render); function render(context: piweb.drawing.DrawingContext) { const buffer = piweb.resources.readFileBufferSync("icon.png"); const image = new piweb.drawing.Bitmap(buffer); context.drawImage(image); }