simple-mixin

Simple mixins for javascript programs

npm install simple-mixin
8 downloads in the last week
16 downloads in the last month

Mixup

Simple mixin for node.js propgrams. Taken from the Testable Javascript Google Tech Talk

Installation

npm install -S simple-mixin'

Usage

var mixin = require('simple-mix')
var Base = function() {
  this.name = 'base name'
}
Base.prototype.save = function() {
  console.log('save called for name: ' + this.name)
}

var Extendable = function() {
  this.name = 'extandable name'
}
var base = new Base()
var extendable = new Extendable()
mixin(base, extendable)
extendable.save()
npm loves you