Here is an example how it's done for total.js 
Here is an example how it's done for total.js
