0.0.1 • Published 9 years ago

baji v0.0.1

Weekly downloads
2
License
MIT
Repository
github
Last release
9 years ago

baji

Build Status

baji.js is a Javascript compiler designed to solve the callback hell problem.

Warning: baji is still under development, please do not use it in any production environment.

Example

To solve the callback hell problem, we write code like this:

function code() {
    fs = require('fs');
    fs.readFile('/etc/hosts', 'utf8', kf(err, data));
    if (err) {
        return console.log(err);
    }
    console.log(data);
}

Then baji master compiles it into this:

function code() {
    fs = require('fs');
    fs.readFile('/etc/hosts', 'utf8', function (err, data) {
        if (err) {
            return console.log(err);
        }
        console.log(data);
    });
}

Try baji:

node examples/demo.js

LICENSE

MIT License

0.0.1

9 years ago