0.0.2 • Published 12 years ago

rush v0.0.2

Weekly downloads
38
License
-
Repository
github
Last release
12 years ago

Rush

The ultimate solution of writing asyncronous code in a beautiful way.

Installation

npm install rush

Example

var rush = require('rush');

rush({
	n: 0
	data: []
})(function() {
	this.n++;
	
	fs.readFile('file1.txt', this(function(data) {
		this.data.push(data);
	}));
	
	fs.readFile('file2.txt', this(function(data) {
		this.data.push(data);
	}));
})(function() {
	this.n++;
	
	fs.readFile('file3.txt', this(function(data) {
		this.data.push(data);
	}));
})(function(err) {
	console.log(n); // => 2
	// this.data should have 3 items:
	// (data of) file1, file2, file3 or file2, file1, file3.
})();

License

MIT