Loading Modules
Jwno can utilize Janet modules to extend itself. To make it more convenient for the user, it will first search for modules in the same directory where its config file resides. Say you have a config file C:\path\to\jwno-config.janet
. When evaluating the code below to import a module,
(import awesome-module)
Jwno will search in the directory C:\path\to\
, for a file named awesome-module.janet
. Compiled .jimage
and .dll
files can be loaded too, but see the development guide for caveats.
Besides the default location, you can specify extra paths for Jwno to search modules from. Just use the --mod-path
(or simply -m
) command line option when launching jwno.exe
:
jwno.exe --mod-path C:\path\to\some\modules\ --mod-path C:\path\to\some\other\modules\
As you can see, --mod-path
can be specified multiple times. Jwno will first search the paths given by --mod-path
, in the order they appear in the command line, then it will fallback to the directory where your config file resides. In other words, --mod-path
overrides the default location.
Built-In Modules
Jwno comes with some built-in modules that are embeded in jwno.exe
, so you can import and use them directly in your code, without requiring separate .janet
or .dll
files.
Built-in modules providing high-level APIs have the jwno/
prefix, and those providing low-level Win32 APIs have the jw32/
prefix instead.