This package has been deprecated

Author message:

Use Function#bind()

thus

1.0.0 • Public • Published

thus

Create a JavaScript scope in which the enclosing function's first argument is referred to as `this'.

This is primarily a convenience function for writing CoffeeScript:

thus express()->
    @set 'view engine''jade'
    @listen 8080

Expressed in JS, that would be:

thus(express(), function() {
    this.set('view engine', 'jade');
    this.listen(8080);
});

Which is functionally equivalent to:

var app = express();
app.set('view engine', 'jade');
app.listen(8080);

Might seem stupid, but I like writing code this way.

Package Sidebar

Install

npm i thus

Weekly Downloads

2

Version

1.0.0

License

none

Last publish

Collaborators

  • bchociej