I wanted a small utility (858B bytes minified/413 bytes gzipped) that could easily be used in a cross-browser fashion and still be AMD and Node.js compatible.
yeahh… that's the only reason.
- It's a sugar for Prototypal Inheritance, not a Class system…
- A decent page for tests.
- Finish testing.
- Polyfill for the Object.getPrototypeOf and Object.isPrototypeOf methods
$ npm install Blueprint-Sugar
var Blueprint = require('Blueprint-Sugar');
var Example = Blueprint.create({
init : function(){},
method1 : function(){},
method2 : fucntion(){}
});
var example = Example.create();
var example = Example.create({
anotherMethod : function () {}
});
// I find myself adding properties/methods to instances a lot,
// this is just a helper. Could ease some work while working
// with mixins…
example.implement({
moreMethods : function () {},
moreProperties : 2
});
Feel free to pull requests, open issues and so on… right now i'm quite open to ideas, improvements and suggestions.