1.2.3 • Published 10 years ago

js-toolbox v1.2.3

Weekly downloads
20
License
-
Repository
github
Last release
10 years ago

JS Toolbox

Author: Rich Hildred forked from Jimmy Do

License: MIT

Class based inheritance in the style of BackBone in JavaScript code for Node.js.

index.js

Provides a primitive base class (Toolbox.Base) for class-based inheritance. Based on code from Backbone (http://documentcloud.github.com/backbone/).

var Toolbox = require('js-toolbox');
var assert = require('assert');

var Animal = Toolbox.Base.extend({
    constructor: function (name) {
        this._name = name;
    },
    sayName: function () {
        return('Hi, my name is ' + this._name);
    }
});

var oAnimal = new Animal("Tony the Tiger");
assert(oAnimal.sayName() === 'Hi, my name is Tony the Tiger');

Depends on:

1.2.3

10 years ago

1.2.2

10 years ago

1.2.1

10 years ago

1.2.0

10 years ago

1.1.0

10 years ago

1.0.0

11 years ago