lib/dev.js
function installModule (module, modulesDir, callback) {

    let details = module.split('/');
    let devModulePath = resolve(modulesDir, module);

    fs.access(resolve(modulesDir, module), err => {

        // skip next steps if module already exists
        if (!err || err.code !== 'ENOENT') {
            return callback();
        }

        exec('git clone git@github.com:' + details[0] + '/' + details[1] + '.git ' + devModulePath, err => {

            if (err) {
                return callback(err);
            }

            exec('cd ' + devModulePath + '; npm i', err => {

                if (err) {
                    return callback(err);
                }

                // create a symlink to the babelify presets
                // it is required in order for babelify to work
                fs.symlink(resolve(__dirname, '../../', 'babel-preset-es2015'), resolve(devModulePath, 'node_modules/babel-preset-es2015'), err => {

                    if (err) {
                        return callback(err);
                    }

                    callback();
                });
            });
        });
    });
}
function installModule (module, modulesDir, callback) {

    let details = module.split('/');
    let devModulePath = resolve(modulesDir, module);

    fs.access(resolve(modulesDir, module), err => {

        // skip next steps if module already exists
        if (!err || err.code !== 'ENOENT') {
            return callback();
        }

        exec('git clone git@github.com:' + details[0] + '/' + details[1] + '.git ' + devModulePath, err => {

            if (err) {
                return callback(err);
            }

            exec('cd ' + devModulePath + '; npm i', err => {

                if (err) {
                    return callback(err);
                }

                // create a symlink to the babelify presets
                // it is required in order for babelify to work
                fs.symlink(resolve(__dirname, '../../', 'babel-preset-es2015'), resolve(devModulePath, 'node_modules/babel-preset-es2015'), err => {

                    if (err) {
                        return callback(err);
                    }

                    callback();
                });
            });
        });
    });
}
function installModule ( module , modulesDir , callback ) { let details = module . split ( '/' ) ; let devModulePath = resolve ( modulesDir , module ) ; fs . access ( resolve ( modulesDir , module ) , err => { // skip next steps if module already exists if ( ! err || err . code !== 'ENOENT' ) { return callback ( ) ; } exec ( 'git clone git@github.com:' + details [ 0 ] + '/' + details [ 1 ] + '.git ' + devModulePath , err => { if ( err ) { return callback ( err ) ; } exec ( 'cd ' + devModulePath + '; npm i' , err => { if ( err ) { return callback ( err ) ; } // create a symlink to the babelify presets // it is required in order for babelify to work fs . symlink ( resolve ( __dirname , '../../' , 'babel-preset-es2015' ) , resolve ( devModulePath , 'node_modules/babel-preset-es2015' ) , err => { if ( err ) { return callback ( err ) ; } callback ( ) ; } ) ; } ) ; } ) ; } ) ; }
this will clone and install all the required dependencies of a module
this will clone and install all the required dependencies of a module