jscore
v1.0.9
Published
A small library providing some class functionality.
Downloads
13
Readme
(js)Core Class library
Install
As always, use the npm package manager:
npm install jscore
Local usage:
var Core = require('jscore');
var example1 = Core.define('example1', {
constructor: function() {
// constructor method.
}
});
var example2 = Core.define('example2', {
extend: 'example1',
constructor: function() {
this._super(); // Call super.
}
});
Global usage:
app.js:
require('jscore').makeGlobal(); // Puts Core in global scope.
Core.Loader.addPrefix('ApplicationName', 'fancy'); // add loader reference to folder 'fancy' for name 'ApplicationName'
Core.define('app', {
extend: 'ApplicationName.base', // Auto loads fancy/base.js
requires: [
'data.file' // Auto loads data.file into global scope.
],
constructor: function() {
var file = new data.file();
}
});
data/file.js:
Core.define('data.file', {
});
fancy/base.js:
Core.define('ApplicationName.base', {
});