Skip to content

A Javascript compiler designed to solve the callback hell problem.

License

Notifications You must be signed in to change notification settings

kungfu-toolbox/baji

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

A Javascript compiler designed to solve the callback hell problem.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published