docs: function launch(options, callback) {
    if( arguments.length === 1 ) {
      if( typeof options == 'function' ) {
        callback = options;
        options = null;
      } else if( typeof options == 'number' ) {
        options = {port:options, mkdirs:true};
      }
    }
    
    callback = typeof callback == 'function' ? callback : function(err, ps) {
      if( err ) return console.error(err.stack);
      console.log('mongodb started, pid:' + ps.pid);
    };
    
    options = options || {};
    var basedir = path.join(os.homedir(), '.mongolauncher');
    var timeout = +options.timeout && +options.timeout > 0 ? +options.timeout : 10000;
    var port = +options.port || 27017;
    var username = options.username;
    var password = options.password;
    var authdb = options.authdb || 'admin';
    var dbpath = options.dbpath || path.join(basedir, 'db');
    var logpath = options.logpath;
    var mkdirs = options.mkdirs === false ? false : true;
    var version = options.version;
    var bind_ip = options.bind_ip;
    var encoding = options.encoding;
    var cwd = options.cwd || process.cwd();
    var env = options.env;
    var auth = options.auth;
    var detached = options.detached === true ? true : false;
    var argv = options.argv || [];
    var stdout = options.stdout;
    var stderr = options.stderr;
    
    dbpath = dbpath ? untildify(dbpath) : null;
    logpath = logpath ? untildify(logpath) : null;
    
    if( logpath && typeof logpath != 'string' ) logpath = path.join(path.dirname(dbpath), 'logs', 'mongo.log');
    if( ~argv.indexOf('--logpath') ) return callback(new Error('--logpath arg is not supported, use options.logpath instead'));
    
    if( mkdirs ) {
      if( !fs.existsSync(path.resolve(process.cwd(), dbpath)) ) {
        fse.ensureDirSync(path.resolve(process.cwd(), dbpath), 0777);
      }
      
      if( logpath && !fs.existsSync(path.dirname(logpath)) ) {
        fse.ensureDirSync(path.dirname(logpath), 0777);
      }
    }
    
    var logger;
    if( logpath ) {
      if( fs.existsSync(logpath) ) {
        fs.renameSync(logpath, logpath + '-' + (new Date().toISOString()));
      }
      
      logger = fs.createWriteStream(logpath, { flags: 'w' });
    }
    
    installer.ensureInstall({
      version: version
    }, function(err, info) {
      if( err ) return callback(err);
      
      if( dbpath ) argv = argv.concat(['--dbpath', dbpath]);
      if( bind_ip ) argv = argv.concat(['--bind_ip', bind_ip]);
      if( port ) argv = argv.concat(['--port', port]);
      
      var config = {
        cwd: cwd
      };
      
      if( encoding ) config.encoding = encoding;
      if( env ) config.env = env;
      if( detached ) config.detached = detached;
      
      mongod({
        bin: info.bin,
        argv: argv,
        config: config,
        stdout: stdout,
        stderr: stderr,
        logger: logger
      }, function(err, ps) {
        if( err ) return callback(err);
        if( !auth ) return callback(null, ps);
        
        if( !username ) {
          ps.kill();
          return callback(new Error('missing options.username'));
        }
        
        if( !password ) {
          ps.kill();
          return callback(new Error('missing options.password'));
        }
        
        var cmds = authdb == 'admin' ? [
          `${path.join(info.bin, 'mongo')} --port ${port} ${authdb} --eval "db.dropUser('${username}')"`,
          `${path.join(info.bin, 'mongo')} --port ${port} ${authdb} --eval "db.createUser(
            {
              user: '${username}',
              pwd: '${password}',
              roles: [
                { role: 'userAdminAnyDatabase', db: '${authdb}' },
                { role: 'dbAdminAnyDatabase', db: '${authdb}' },
                { role: 'readWriteAnyDatabase', db: '${authdb}' }
              ]
            }
          )"`
        ] : [
          `${path.join(info.bin, 'mongo')} --port ${port} ${authdb} --eval "db.dropUser('${username}')"`,
          `${path.join(info.bin, 'mongo')} --port ${port} ${authdb} --eval "db.createUser(
            {
              user: '${username}',
              pwd: '${password}',
              roles: [
                { role: 'readWrite', db: '${authdb}' }
              ]
            }
          )"`
        ];
        
        exec(cmds.join(' && '), function(err, out, errmsg) {
          if( err ) {
            if( stderr ) stdout.write(out);
            if( logger ) logger.write(errmsg);
            ps.kill();
            return callback(err);
          }
          
          if( stdout ) stdout.write(out);
          if( logger ) logger.write(out);
          
          ps.kill(function(err) {
            if( err ) return callback(err);
            
            mongod({
              bin: info.bin,
              argv: argv.concat(['--auth']),
              config: config,
              stdout: stdout,
              stderr: stderr,
              logger: logger
            }, callback);
          });
        });
      });
    });
  }