Skip to content
Todd Whiteman edited this page May 5, 2014 · 5 revisions

Komodo 9 introduces the require('module') function (CommonJS specification) to be able to load JavaScript files on demand.

Example:

var logging = require("ko/logging");

Add-ons

Add-ons can define their own require names by adding a special require-path xpcom category entry into their chrome.manifest file:

category require-path commando chrome://commando/content/js/

and then they make use of their JS modules like so:

var proj = require("commando/project");

which would map to the chrome://commando/content/js/project.js file.