This isn't very useful yet. So far you can load scripts, scripts can load scripts, scripts can load interfaces (like "irssi"). The only interface available so far is "irssi", which lets you bind and unbind commands. == Commands == * /js exec <code> On startup, a module is created called "<cmdline>" .. this lets you evaluate code in that module. * /js open <script> This will "require" a script, from (by default) $HOME/.xchat/js/ - the path is figured out based on Irssi's configured directory. It works like require() in CommonJS so may not actually do anything. * /js list [all] This lists contexts which have been loaded and have not tried to exit - all shows all contexts. (I'll add a "hidden" property on the module objects for controlling this). == Global values == A global object is created for every module; one for <cmdline> on module load, and one for each script that gets executed. A set of standard objects should exist here too: Array, Object, etc. * global The global object (basically, window in a browser script, named to avoid confusion between Irssi's windows). * require A function that takes one argument. Gets the exports object (and maybe runs the script) as described in CommonJS/Modules (interface not yet complete). * exports The object representing the module's exports, as described by CommonJS. == Irssi == An Irssi object can be created using require("irssi"). This lets you interact with Irssi, currently the interface looks something like this (early development): interface Irssi { Bind bindCommand(string name, void callback(string arguments)); }; interface Bind { void unbind(); }; == Test == Currently there's also another built-in module called "test", it just has a .print function, for printing to the current window.