chest-src v1.4.73
chest-src
Dynamic require in the browser and a few other lightweight tools...
Getting Started
In conjuction with grunt-chest-compiler, this tool allows you to use nodejs's style of require calls on the browser side (along with module.exports), and it loads "required" modules automatically and asynchronously. It stores dependencies in localStorage so you might have to clear it every once in a while, for that reason and more this is still an experimental tool.
It also ships with a few small default modules: extend, jmap and zipcookie.
Here is an example of inheritance and inclusion you can probably identify with:
var extend = require('extend');
function mammel(name, age){
this.name = name;
this.age = age;
}
mammel.prototype = {
talk: function(){
return ': hello, my name is ' + this.name + ', i\'m ' + this.age + '.';
}
};
function dog(name, age){
super(name, age);
}
dog.prototype.talk = function(a){
return 'barkeese' + super.talk(a);
};
extend(dog, mammel);
var bob = new dog('bob', 21);
console.log(bob.talk('hello'));
module.exports = dog;
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago