//Universal js Clone function (we think...) //Works for any js object
Release : 0.1.0 initial release
Install :
Create a directory : mkdir node-clone Go to your directory : cd node-clone Clone the repository : git clone https://github.com/Nais/node-clone.git Install : npm link .
Or simply install from npm : npm install node-clone
Example :
//clone setTimeout var Clone=require('node-clone').Clone(setTimeout);
//define my custom setTimeout var myCustomsetTimeout=function(){if (typeof(arguments[0])!='function') console.log('it is not good to call setTimeout not using a function'); Clone.apply(this,arguments); }
//replace setTimeout by my custom setTimeout setTimeout=myCustomsetTimeout;
setTimeout(function(){console.log('Hello World');},1000);