Janet 1.0.0-dev Documentation
module/*headerpath* var (string)
The path where the janet headers are installed. Useful for building native modules or compiling code at runtime.
module/*syspath* var (string)
The path where globally installed libraries are located. The default is set at build time and is /usr/local/lib/janet on linux/posix, and on Windows is C:/Janet/Library.
Table mapping loaded module identifiers to their environments.
(module/find path) Try to match a module or path name from the patterns in module/paths. Returns a tuple (fullpath kind) where the kind is one of :source, :native, or image if the module is found, otherwise a tuple with nil followed by an error message.
A table of loading method names to loading functions. This table lets require and import load many different kinds of files as module.
Table mapping currently loading modules to true. Used to prevent circular dependencies.
The list of paths to look for modules. The following substitutions are preformed on each path. :sys: becomes module/*syspath*, :name: becomes the last part of the module name after the last /, and :all: is the module name literally. :native: becomes the dynamic library file extension, usually dll or so. Each element is a two element tuple, containing the path template and a keyword :source, :native, or :image indicating how require should load files found at these paths.