basic-node

0.1.0 • Public • Published

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);

Readme

Keywords

none

Package Sidebar

Install

npm i basic-node

Weekly Downloads

0

Version

0.1.0

License

BSD-3-Clause

Last publish

Collaborators

  • davidglivar