Table of Contents

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


var logging = require("ko/logging");
You can find available modules here:

For example you can get the language of the current file:

var language = require("ko/editor").getLanguage();
Function getLanguage() defined in editor.js:


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.


Komodo's require functionality is built on top of the Mozilla Addon SDK, so nearly all of the APIs defined there can be used inside of Komodo. I say nearly, as some things are obviously different (e.g. the Firefox browser has web page tabs).