t/f = load(file)
The load() function loads, compiles and executes a JavaScript source file. The executed code is typically an outer function containing library set-up code, to install one or more functions or other objects into the global object. After this, the code returns and the main program continues. Any objects installed by the library remain available for the duration of the rest of the program — unless they are deleted or replaced with other objects.
The argument must be a valid file name, without any preceding path information. It is searched for first in the same directory as the main program. Then in /lib/jsus, /usr/lib/jsus and /usr/local/lib/jsus. For security, every library file must always be loaded from one of these trusted directories.
If successful, true is returned and any instantiated objects can then be used within the main JavaScript program. If the source code fails to compile, or execute, the entire program is terminated in error, with appropriate information on stderr.
During development, the library source file is best kept in a separate directory together with any programs needed to test it. The standard search order, above, gives test programs access to the latest development version of the library. Then, after testing, the library is copied into one of the standard system directories, making it available to all user programs.
By informal convention, we name all of our own libraries beginning with the prefix jsus (for example, /lib/jsus/jsus.Scroll). You should create a different prefix for your own organization and your libraries should normally be installed in /usr/lib/jsus or /usr/local/lib/jsus.
Running JavaScript programs with JSUS.