0.1.0 • Published 9 years ago

basic-node v0.1.0

Weekly downloads
2
License
BSD-3-Clause
Repository
github
Last release
9 years ago

basic-node

Constructor implementing a basic Node interface.

Installation

npm install basic-node

Usage

A basic example:

var Node = require('basic-node')
  , parent = new Node()
  , child = new Node();

child.on('added', function () {
  console.log('child has been added to', child.parent);
});

child.on('removed', function () {
  console.log('child no longer has a parent');
});

parent.add(child);

console.log(parent.children.length); // => 1

parent.remove(child);
0.1.0

9 years ago

0.0.3

9 years ago