Skip to content

bchociej/thus

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

thus

Create a JavaScript scope in which thus'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.

About

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published