New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

wrap

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

wrap

Wrap is Prototype.js style context wrapping it in another function

latest
Source
npmnpm
Version
0.1.2
Version published
Weekly downloads
102
59.38%
Maintainers
1
Weekly downloads
 
Created
Source

Wrap

Wrap is Prototype.js style context wrapping it in another function in NodeJS.

  • Tiny!
  • Fast!
  • Easy!
  • Useful!

Installing

GIT

$ git clone git://github.com/firejune/wrap.git

NPM

$ npm install wrap

Code

var wrap = require('wrap');

function MyClass() {
  this.value = "Hello World!";
  this.doSomething();
}

MyClass.prototype.doSomething = function() {
  //self = this;
  setTimeout(function() {
    //console.log(self.value);
    console.log(this.value);
  }.wrap(this), 100);
};

new MyClass();
//=> "Hello World!"

Have fun!

License

MIT <3

Keywords

wrap

FAQs

Package last updated on 19 Oct 2011

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts