The Khan Academy utility library.
Explore the docs »
Table of Contents
The Essentials library delivers functionality, performance and pushes the limits of what is possible with Khan Academy's Processing.js environment. Essentials is a one-of-a-kind library designed to make the programming experience on Khan less about working around it's restrictions and more about transforming your ideas into reality.
Khan Academy doesn't offer an equivalent of modules, leaving it to programmers to reinvent the wheel for themselves even for the most trivial of tasks. Not to mention the countless bugs that Khan's port of Processing.js has been riddled with. Most of which, mind you, have been long patched on the original repository. Although most of these are completely irreparable, others have workarounds which are included with the library.
The Essentials library uses the following open-source projects:
A list of all dependencies defined in package.json and package-lock.json is available in the Dependency graph.
Create a new program on Khan Academy or use an existing project and paste the following boilerplate code:
// jshint ignore: start
$.ajaxSetup({ cache: true });
$.getScript('https://cdn.jsdelivr.net/gh/bhavjitChauhan/essentials@2/essentials.min.js',
function() {
// your code here
}
);
See alternative methods in the Integration tutorial.
The recommended method to generate any boilerplate code for the Essentials library is to use the Builder. See other ways of reducing file sizes and load times in the Customize tutorial.
After loading the Essentials library its functions and constants are defined in the global scope, they can be called directly.
For live examples, please refer the Integration tutorial.
Documentation is generated using JSDoc, using the BetterDocs theme and hosted on GitHub Pages.
Distributed under the MIT License. See LICENSE for more information.
Credit is given to the original authors of functions via links in the documentation.