pkgscript.js
function(config, init, callback) {

            var me = this;

            // first initialize
            if (init) {
                this.init(init);
            }

            logger.log2file("\n\n************ Package Script  ************************************* process id: " + process.pid);

            if (config && _.isArray(config)) {
                commands = commands.concat(config);
                size = commands.length;
                if (size > 0) {
                    install(commands, function() {
                        logger.logall("[package-script] process completed, see pkgscript.log for more information");
                        if (callback) {
                            callback.call(me);
                        }
                    });
                }

            } else {
                logger.logall("[package-script] No valid configuration for 'install' function, see the docs for more information ");
            }
        }
function(config, init, callback) {

            var me = this;

            // first initialize
            if (init) {
                this.init(init);
            }

            logger.log2file("\n\n************ Package Script  ************************************* process id: " + process.pid);

            if (config && _.isArray(config)) {
                commands = commands.concat(config);
                size = commands.length;
                if (size > 0) {
                    install(commands, function() {
                        logger.logall("[package-script] process completed, see pkgscript.log for more information");
                        if (callback) {
                            callback.call(me);
                        }
                    });
                }

            } else {
                logger.logall("[package-script] No valid configuration for 'install' function, see the docs for more information ");
            }
        }
function ( config , init , callback ) { var me = this ; // first initialize if ( init ) { this . init ( init ) ; } logger . log2file ( "\n\n************ Package Script  ************************************* process id: " + process . pid ) ; if ( config && _ . isArray ( config ) ) { commands = commands . concat ( config ) ; size = commands . length ; if ( size > 0 ) { install ( commands , function ( ) { logger . logall ( "[package-script] process completed, see pkgscript.log for more information" ) ; if ( callback ) { callback . call ( me ) ; } } ) ; } } else { logger . logall ( "[package-script] No valid configuration for 'install' function, see the docs for more information " ) ; } }
spawn additional command according to the config

@param config The configuration for the spawn
e.g. [{
admin: true, [optional (for now, linux support only)],
spawnopt: {cwd: '.'} [optional] (see child_process spawn docs)
command: 'npm',
args: ["--version"]
}]

@param init The initial configuration, can be set in separate method (see 'init')
@param callback The callback functionality
spawn additional command according to the config