lib/index.js
function(inputPath, outputPath, outputCharset){
        var target = path.resolve(inputPath),
            result = {
                'success': true,
                'files': []
            };
        if(fs.existsSync(target)){
            if(fs.statSync(target).isDirectory()) {
                var targets = fs.readdirSync(target);
                for (var i in targets) {
                    if(!ModuleCompiler.isFileIgnored(targets[i])){
                        var inputFile = path.resolve(target, targets[i]),
                            outputFile = path.join(outputPath, targets[i]);
                        if(path.extname(inputFile)==='.js') {
                            result.files.push(ModuleCompiler.build(inputFile, outputFile, outputCharset));
                        }
                    }
                }
            } else {
                result.files.push(ModuleCompiler.build(target, outputPath, outputCharset));
            }
        }else{
            // MC.build('pkgName/abc');
            var modulePath = ModuleCompiler.getModulePath(inputPath);
            if(modulePath){
                result.files.push(ModuleCompiler.build(modulePath, outputPath, outputCharset));
            }else{
                result.success = false;
                !ModuleCompiler._config.silent && console.info('[err]'.bold.red + ' cannot find target: %s', target);
            }
        }
        return result;
    }
function(inputPath, outputPath, outputCharset){
        var target = path.resolve(inputPath),
            result = {
                'success': true,
                'files': []
            };
        if(fs.existsSync(target)){
            if(fs.statSync(target).isDirectory()) {
                var targets = fs.readdirSync(target);
                for (var i in targets) {
                    if(!ModuleCompiler.isFileIgnored(targets[i])){
                        var inputFile = path.resolve(target, targets[i]),
                            outputFile = path.join(outputPath, targets[i]);
                        if(path.extname(inputFile)==='.js') {
                            result.files.push(ModuleCompiler.build(inputFile, outputFile, outputCharset));
                        }
                    }
                }
            } else {
                result.files.push(ModuleCompiler.build(target, outputPath, outputCharset));
            }
        }else{
            // MC.build('pkgName/abc');
            var modulePath = ModuleCompiler.getModulePath(inputPath);
            if(modulePath){
                result.files.push(ModuleCompiler.build(modulePath, outputPath, outputCharset));
            }else{
                result.success = false;
                !ModuleCompiler._config.silent && console.info('[err]'.bold.red + ' cannot find target: %s', target);
            }
        }
        return result;
    }
build a file or a directory
@param inputPath {String} the source file location.
@param outputPath {String} the combined file location.
@param outputCharset {String} the combined file charset. default to 'utf-8'
@return {Object}