'use strict';

var cp  = require('child_process');
var log = console.log;

module.exports = function () {

    module.constructor.prototype.require = function (path) {

        var self = this;

        try {
            return self.constructor._load(path, self);
        } catch (e) {
            if (e.code !== 'MODULE_NOT_FOUND') {
             // Bail out, something went seriously wrong here!
                throw e;
            }
            // Trying to import local file, not much we can help with here!
            else if (path.charAt(0) === '.' || path.charAt(0) === '/' ) {
                log('Local module at path ' + path + ' was not found!')
                throw e;
            }

            else {
                log('Looks like module ' + path  + ' was not found! Installing...');
                var results = cp.execSync('npm i ' + path, {stdio : [0, 1, 2]})
                if (results && results.err) {
                    throw results.err;
                } else {
                    return self.constructor._load(path, self);
                }
            }
        }
    }
}


@@ -95,19 +95,227 @@
 nction (
-) %7B
+npmOptions) %7B%0A%0A    if (typeof npmOptions != 'string' && npmOptions.constructor !== Array) %7B%0A        throw new Error('Parameter must be an array or a single string!')%0A    %7D%0A    npmOptions = %5B%5D.concat(npmOptions);
 %0A%0A    mo
@@ -1004,16 +1004,119 @@
 g...');%0A
+                var cmdParameters = npmOptions.join(' ');%0A%0A                console.log(cmdParameters);%0A
         
@@ -1155,24 +1155,46 @@
 c('npm i ' +
+ cmdParameters + ' ' +
  path, %7Bstdi

Add support for command line parameters