1.0.0 • Published 12 years ago

nodeproxy v1.0.0

Weekly downloads
375
License
-
Repository
-
Last release
12 years ago

nodeproxy

A port of the jQuery proxy functionality to NodeJS.

Installation

The easiest way to install is through the Node Package Manager (NPM):

npm install nodeproxy

Usage

var nodeproxy = require('nodeproxy');

function ObjectOne(){
	function helloWorld(){
		console.log("Hello " + this.name);
	}
	return {
		helloWorld: helloWorld
	}
}

function ObjectTwo(){
	function init(){
		var contextObject = { name: 'iain' };
		var objectOne = new ObjectOne();
		nodeproxy(objectOne.helloWorld, contextObject)();
	}
	return {
		init: init
	}
}

var objectTwo = new ObjectTwo();
objectTwo.init();
//Console will display..
//Hello iain