---------------------------------------------------------------------------------------------------------------------
tgi-core/lib/core/tgi-core-transport.source.js
 /* istanbul ignore next
431390
function Transport(location, callback) {
  if (false === (this instanceof Transport)) throw new Error('new operator required');
  if (typeof location != 'string') throw new Error('argument must a url string');
  if (typeof callback != 'function') throw new Error('argument must a callback');
  var self = this;
  self.connected = false;
  self.initialConnect = true;
  self.location = location;
  if (self.location === '') self.location = 'http host';
  self.socket = io.connect(location, {reconnection: false});
  self.socket.on('connect', function () {
    self.connected = true;
    self.initialConnect = false;
    console.log('socket.io (' + self.location + ') connected');
    callback.call(self, new Message('Connected', ''));
  });
  self.socket.on('connecting', function () {
    console.log('socket.io (' + self.location + ') connecting');
  });
  self.socket.on('error', function (reason) {
    var theError = 'general error with ' + self.location + (reason ? ', reason ' + reason : '');
    console.error(theError);
    // If have not ever connected then signal error
    if (self.initialConnect) {
      callback.call(self, new Message('Error', theError));
    }
  });
  self.socket.on('connect_error', function (reason) {
    var theError = 'connect error with ' + self.location + (reason ? ', reason ' + reason : '');
    console.error(theError);
    // If have not ever connected then signal error
    if (self.initialConnect) {
      callback.call(self, new Message('Error', theError));
    }
  });
  self.socket.on('connect_failed', function (reason) {
    var theError = 'connect failed with ' + self.location + (reason ? ', reason ' + reason : '');
    console.error(theError);
    // If have not ever connected then signal error
    if (self.initialConnect) {
      callback.call(self, new Message('Error', theError));
    }
  });
  self.socket.on('message', function (obj) {
    if (self.rawCallBack) {
      self.rawCallBack(obj);
    } else {
      console.log('socket.io (' + self.location + ') message: ' + obj);
    }
  });
  self.socket.on('disconnect', function (reason) {
    self.connected = false;
    console.log('socket.io (' + self.location + ') disconnect: ' + reason);
  });
}
50369
function () {
/*Line 88 - 'AtomNavigatorList.js' */                var v = this._displayMode;
/*Line 89 - 'AtomNavigatorList.js' */                if (v == 0) {

/*Line 91 - 'AtomNavigatorList.js' */                    if (this._detailPresenter) {
/*Line 92 - 'AtomNavigatorList.js' */                        this._detailView.atomControl.dispose(this._detailPresenter);
/*Line 93 - 'AtomNavigatorList.js' */                        this._detailPresenter = null;
/*Line 94 - 'AtomNavigatorList.js' */                    }
/*Line 95 - 'AtomNavigatorList.js' */                    if (this._newPresenter) {
/*Line 96 - 'AtomNavigatorList.js' */                        this._newView.atomControl.dispose(this._newPresenter);
/*Line 97 - 'AtomNavigatorList.js' */                        this._newPresenter = null;
/*Line 98 - 'AtomNavigatorList.js' */                    }
/*Line 99 - 'AtomNavigatorList.js' */                    if (this._detailHeaderPresenter) {
/*Line 100 - 'AtomNavigatorList.js' */                        this._detailView.atomControl.dispose(this._detailHeaderPresenter);
/*Line 101 - 'AtomNavigatorList.js' */                        this._detailHeaderPresenter = null;
/*Line 102 - 'AtomNavigatorList.js' */                    }
/*Line 103 - 'AtomNavigatorList.js' */                    if (this._newHeaderPresenter) {
/*Line 104 - 'AtomNavigatorList.js' */                        this._newView.atomControl.dispose(this._newHeaderPresenter);
/*Line 105 - 'AtomNavigatorList.js' */                        this._newHeaderPresenter = null;
/*Line 106 - 'AtomNavigatorList.js' */                    }

/*Line 108 - 'AtomNavigatorList.js' */                    return;
/*Line 109 - 'AtomNavigatorList.js' */                }

/*Line 111 - 'AtomNavigatorList.js' */                var c = null;
/*Line 112 - 'AtomNavigatorList.js' */                var ct = this.getTemplate("detailTemplate");;
/*Line 113 - 'AtomNavigatorList.js' */                var ch = null;
/*Line 114 - 'AtomNavigatorList.js' */                var cht;
/*Line 115 - 'AtomNavigatorList.js' */                var key = "";

/*Line 117 - 'AtomNavigatorList.js' */                if (v == 1) {
/*Line 118 - 'AtomNavigatorList.js' */                    c = this._detailView;
/*Line 119 - 'AtomNavigatorList.js' */                    ch = this._detailHeaderToolbar;
/*Line 120 - 'AtomNavigatorList.js' */                    cht = this.getTemplate("detailHeaderTemplate");
/*Line 121 - 'AtomNavigatorList.js' */                    key = "_detail";
/*Line 122 - 'AtomNavigatorList.js' */                } else {
/*Line 123 - 'AtomNavigatorList.js' */                    c = this._newView;
/*Line 124 - 'AtomNavigatorList.js' */                    ch = this._newHeaderToolbar;
/*Line 125 - 'AtomNavigatorList.js' */                    cht = this.getTemplate("newHeaderTemplate");
/*Line 126 - 'AtomNavigatorList.js' */                    key = "_new";
/*Line 127 - 'AtomNavigatorList.js' */                }

/*Line 129 - 'AtomNavigatorList.js' */                if (ch && cht) {
/*Line 130 - 'AtomNavigatorList.js' */                    cht = AtomUI.cloneNode(cht);
/*Line 131 - 'AtomNavigatorList.js' */                    this.addTemplate(ch, cht, true);
/*Line 132 - 'AtomNavigatorList.js' */                    this[key + "HeaderPresenter"] = cht;
/*Line 133 - 'AtomNavigatorList.js' */                }

/*Line 135 - 'AtomNavigatorList.js' */                if (c && ct) {
/*Line 136 - 'AtomNavigatorList.js' */                    ct = AtomUI.cloneNode(ct);
/*Line 137 - 'AtomNavigatorList.js' */                    this.addTemplate(c, ct, true);
/*Line 138 - 'AtomNavigatorList.js' */                    this[key + "Presenter"] = ct;
/*Line 139 - 'AtomNavigatorList.js' */                }
/*Line 140 - 'AtomNavigatorList.js' */            }
282354
function Global(transport, fastPathTransport) {
	this.transport = transport;
	this.fastPathTransport = fastPathTransport;
	// must be init via connect event
	this.userId = 0;
	this.serverCapabilities = [];
	this.clientCapabilities = [];
}
163893
function compileSourcePreCode() {
    var $version = '##version##';

    var componentRenderers = {};

    function extend(target, source) {
        if (source) {
            Object.keys(source).forEach(function (key) {
                var value = source[key];
                if (typeof value !== 'undefined') {
                    target[key] = value;
                }
            });
        }

        return target;
    }

    function each(array, iterator) {
        if (array && array.length > 0) {
            for (var i = 0, l = array.length; i < l; i++) {
                if (iterator(array[i], i) === false) {
                    break;
                }
            }
        }
    }

    function contains(array, value) {
        var result;
        each(array, function (item) {
            result = item === value;
            return !result;
        });

        return result;
    }

    var HTML_ENTITY = {
        /* jshint ignore:start */
        '&': '&amp;',
        '<': '&lt;',
        '>': '&gt;',
        '"': '&quot;',
        /* eslint-disable quotes */
        "'": '&#39;'
        /* eslint-enable quotes */
        /* jshint ignore:end */
    };

    function htmlFilterReplacer(c) {
        return HTML_ENTITY[c];
    }

    function escapeHTML(source) {
        if (source == null) {
            return '';
        }

        if (typeof source === 'string') {
            return source ? source.replace(/[&<>"']/g, htmlFilterReplacer) : '';
        }

        return '' + source;
    }

    function _classFilter(source) {
        if (source instanceof Array) {
            return source.join(' ');
        }

        return source;
    }

    function _styleFilter(source) {
        if (typeof source === 'object') {
            var result = '';
            if (source) {
                Object.keys(source).forEach(function (key) {
                    result += key + ':' + source[key] + ';';
                });
            }

            return result;
        }

        return source;
    }

    function _xclassFilter(source) {
        if (source instanceof Array) {
            source = source.join(' ');
        }

        return source ? ' ' + source : '';
    }

    function _xstyleFilter(source) {
        var result;
        if (typeof source === 'object') {
            result = '';
            if (source) {
                Object.keys(source).forEach(function (key) {
                    result += key + ':' + source[key] + ';';
                });
            }
        }
        else {
            result = source;
        }

        return result ? ';' + result : '';
    }

    function attrFilter(name, value) {
        if (value) {
            return ' ' + name + '="' + value + '"';
        }

        return '';
    }

    function boolAttrFilter(name, value) {
        if (value && value !== 'false' && value !== '0') {
            return ' ' + name;
        }

        return '';
    }

    function callFilter(ctx, name, args) {
        var filter = ctx.proto.filters[name];
        if (typeof filter === 'function') {
            return filter.apply(ctx, args);
        }
    }
}
246805
function THttpServer() {
        var _this = _super.call(this) || this;
        _this._app = express();
        _this._app.use(bodyParser.urlencoded({ extended: false }));
        _this._app.use(bodyParser.json());
        _this._app.use(cookieParser());
        _this._app.use(_this.StandardSender);
        _this._server = http.createServer(_this._app);
        _this._connections = [];
        return _this;
    }
60553
function bootstrapAdapters( services, adapterModules, artifacts ) {

   const adapterServices = {
      adapterUtilities: services.adapterUtilities,
      artifactProvider: services.artifactProvider,
      configuration: services.configuration,
      flowService: services.flowService,
      globalEventBus: services.globalEventBus,
      debugEventBus: services.debugEventBus,
      heartbeat: services.heartbeat,
      log: services.log,
      storage: services.storage,
      tooling: services.tooling,
      // TODO (https://github.com/LaxarJS/laxar/issues/363 and https://github.com/LaxarJS/laxar/issues/397)
      // Fixing the latter issue broke laxar-mocks, since it could no longer access the widget loader.
      // To temporarily fix this, we re-add the widget loader to the exposed services.
      // Nevertheless on the medium /short term we want to be able to load single widgets into the page
      // (the first issue above) and use the api that will be created for this in laxar-mocks.
      widgetLoader: services.widgetLoader
   };

   const { log } = services;
   const adapterModulesByTechnology = {};
   const artifactsByTechnology = {};

   adapterModules.forEach( module => {
      adapterModulesByTechnology[ module.technology ] = module;
      artifactsByTechnology[ module.technology ] = { widgets: [], controls: [] };
   } );

   [ 'widgets', 'controls' ].forEach( type => {
      artifacts[ type ].forEach( artifact => {
         const { technology } = artifact.descriptor.integration;
         if( !adapterModulesByTechnology[ technology ] ) {
            const { name } = artifact.descriptor;
            log.fatal( 'Unknown integration technology: [0], required by "[1]"', technology, name );
            return;
         }
         artifactsByTechnology[ technology ][ type ].push( artifact );
      } );
   } );

   const adaptersByTechnology = {};
   Object.keys( adapterModulesByTechnology ).forEach( technology => {
      const adapterModule = adapterModulesByTechnology[ technology ];
      const artifacts = artifactsByTechnology[ technology ];
      adaptersByTechnology[ technology ] = adapterModule.bootstrap( artifacts, adapterServices );
   } );
   return adaptersByTechnology;
}
638622
function f_aktif_kullanici_idleri() {
        var defered = result.dbQ.Q.defer();

        result.rc.multi()
            .sdiffstore("temp_kul", result.kp.kullanici.ssetGenel, result.kp.kullanici.ssetSilinen)
            .expire("temp_kul", 10)
            .smembers("temp_kul")
            .exec(function (_err, _replies) {
                if (_err) {
                    console.log("hata");
                    console.log(_err);
                    defered.reject(_err);
                } else {
                    defered.resolve(_replies[2]);
                }
            });

        return defered.promise;
    }
702992
function(_gulp, _config) {
  if (!_gulp) {
    throw 'Error: A Gulp instance should be passed to the gulpConfig method.';
  }
  gulp = _gulp;
  config = _config || { paths: { src: {}, out: {} } };

  plugins = elaboratePlugins();
  paths = elaboratePaths();

  lrport = _config.liveReloadPort || lrport;
  server = _config.server || (console.error(
      'An Express server should be passed in the configuration.')),
  serverport = _config.port || serverport;

  cleanTmp = function(done) {
    del(paths.src.tmp, { force: _config.forceClean || false }, done);
  };
}
1042879
function cli(program) {
  var source = program.args[0] ? path.resolve(program.args[0]) : null,
      destinations = program.args[1] ? Array.prototype.slice.call(program.args, 1) : [],
      options = {},
      camelton;

  if (!source) {
    console.error('Source file not defined.');
    program.help();
  }

  if (!destinations.length) {
    console.error('Destination file not defined.');
    program.help();
  }

  if (program.prune) {
    options.prune = program.prune;
  }

  if (program.placeholder) {
    options.placeholder = program.placeholder;
  }

  if (program.sort) {
    options.sort = program.sort;
  }

  if (program.verbose) {
    options.verbose = program.verbose;
  }

  try {
    camelton = new Camelton(source, destinations, options);
    camelton.run();
    camelton.report();
    process.exit(0);
  }
  catch (e) {
    console.error(e.message);
    process.exit(1);
  }
}
386650
function bundleHandler (pathToHandlers, module, file) {

    // only rebundle if js file changed
    if (file.length < 3 || file.indexOf('bundle.') === 0 || file.substr(file.length - 3) !== '.js') {
        return;
    }

    // only rebundle if handler was already bundled before
    fs.access(pathToHandlers + '/bundle.' + file, err => {

        if (err && err.code === 'ENOENT') {
            return ;
        }

        let fnIri = module + '/' + file.slice(0, -3);

        // remove the old bundle
        fs.unlink(pathToHandlers + '/bundle.' + file, err => {

            if (err) {
                console.log('Failed to delete old bundle for handler: ' + fnIri);
                return console.log(err);
            }

            // build the new bundle
            console.log('Bundle handler: ' + fnIri);
            runtime.bundle(fnIri, {}, (err) => {

                if (err) {
                    console.log('Failed to bundle handler: ' + fnIri);
                    return console.log(err);
                }

                console.log('Bundle done for handler: ' + fnIri);
            });
        });
    });
}
1050866
function emitServer({
  port,
  prompts,
  promptsForRender,
  whenPrompts,
  withoutWhenPrompts,
  templatePath = DEFAULT_TPL_PATH,
  tplData = {
    title: '😊 Dulcet Inquirer'
  }
}) {
  const string = fs.readFileSync(templatePath).toString()
  const compiled = template(string, { interpolate: /<%=([\s\S]+?)%>/g })

  const emitter = new EventEmitter()
  const promptValues = prompts.reduce(function(set, val) {
    set[val.name] = val
    return set
  }, {})

  const store = withoutWhenPrompts.reduce(function(set, { name, default: _default }) {
    set[name] = _default
    return set
  }, {})

  function getErrorMsg(prompt, value) {
    if (prompt && typeof prompt.validate === 'function') {
      const msg = prompt.validate(value, store)
      if (typeof msg === 'string') {
        return msg
      }
    }
  }
  function getErrors() {
    const errors = {}
    prompts.forEach(function(prompt) {
      const msg = getErrorMsg(prompt, store[prompt.name])
      if (msg) {
        errors[prompt.name] = msg
      }
    })
    return Object.keys(errors).length ? errors : null
  }

  const server = app.listen(port, function() {
    emitter.emit('server-started')
  })
  app._server = server

  app.get('/', function(req, res) {
    res.type('html')
    res.send(
      compiled(
        Object.assign({}, tplData, {
          prompts: promptsForRender
        })
      )
    )
  })

  app.get('/when', function(req, res) {
    const passedList = []
    const failedList = []
    whenPrompts.forEach(function(item) {
      if (item.when(store)) {
        if (!store.hasOwnProperty(item.name)) {
          store[item.name] = item.default
        }
        passedList.push(item)
      } else {
        if (item.name in store) {
          delete store[item.name]
        }
        failedList.push(item)
      }
    })

    pass(res, 'when-passed', {
      passed: passedList.map(item => item.name),
      failed: failedList.map(item => item.name)
    })
  })

  app.get('/set', function(req, res) {
    const { name, value } = JSON.parse(req.query._)
    const prompt = prompts.find(x => x.name === name)
    if (prompt && typeof prompt.validate === 'function') {
      const msg = getErrorMsg(promptValues[name], value)
      if (msg) {
        store[name] = value
        pass(res, 'errors', { [name]: msg })
      } else {
        store[name] = value
        pass(res, 'validate-passed', name)
      }
      return
    }
    // console.log('set:before', store)
    store[name] = value
    // console.log('set:after', store)
    pass(res, 'passed', name)
  })

  // app.get('/transformer', function() {
  //   compiled(prompts)
  // })

  app.post('/submit', function(req, res) {
    // const { values } = req.query
    const errors = getErrors()
    if (errors) {
      pass(res, 'errors', errors)
    } else {
      pass(res, 'close', 'Submit succeed!')

      emitter.emit('done', store)
    }
    // store = values
  })
  return emitter
}
228172
function() {
  // Path to apis.js file
  var apis_js = path.join(__dirname, '../src', 'apis.js');
  // Create content
  // Use json-stable-stringify rather than JSON.stringify to guarantee
  // consistent ordering (see http://bugzil.la/1200519)
  var content = "/* eslint-disable */\nmodule.exports = " + stringify(apis, {
    space: '  '
  }) + ";";
  fs.writeFileSync(apis_js, content, {encoding: 'utf-8'});
}
441025
function Router() {
    var resources = {};

    // Public methods
    this.addRoute = function(resource) {
        var mPoint = resource.getMountPoint();

        if (typeof(resources[mPoint]) === 'undefined') {
            resources[mPoint] = resource;
        } else {
            resources[mPoint].update(resource);
        }
    };

    this.dispatch = function(locals) {
        var accept = locals.getAcceptedTypes();
        var request = locals.getRequest();
        var dispatched = false;
        var header;
        var mountPoint;
        var resource;

        locals.updateResponse(404);
        // Iterate over the resources
        for (mountPoint in resources) {
            // Did anybody flush already?
            resource = resources[mountPoint];
            // Does your URL definition matches this path?
            if (resource.matchesURL(request.path)) {
                locals.updateResponse(405);
                // Do you handle this method?
                if (resource.allowsMethod(request.method)) {
                    locals.updateResponse(406);
                    // Do you understand this format?
                    if (resource.acceptsType(accept, request.method)) {
                        locals.updateResponse(200);
                        // It's all yours
                        resource.takeOver(locals);
                        // And we set a flag announcing it was dispatched
                        dispatched = true;
                    }
                } else {
                    header = resource.getMethods().join(', ');
                    locals.getResponse().setHeader('Allow', header);
                }
            }
        }

        // Each resource emits a 'Resource:postRequest' event that flushes
        // the response. If no resource was found, that event was not emitted
        // and we need to do it manually.
        if (!dispatched) {
            locals.emit('Resource:completed');
            locals.emit('Resource:preRequest');
            locals.emit('Resource:postRequest');
        }
    };
}
213277
function main() {
		var el;

		el = document.querySelector( 'title' );
		cleanTitle( el );

		el = document.querySelectorAll( '.tsd-kind-external-module a' );
		cleanLinks( el );

		el = document.querySelectorAll( '.tsd-is-not-exported a' );
		cleanLinks( el );

		el = document.querySelectorAll( '.tsd-breadcrumb a' );
		cleanLinks( el );

		el = document.querySelectorAll( '.tsd-page-title h1' );
		cleanHeadings( el );

		el = document.querySelectorAll( '.tsd-description .tsd-parameters .tsd-comment p' );
		updateDescriptions( el );

		el = document.querySelectorAll( '.tsd-description .tsd-returns-title + p' );
		updateDescriptions( el );
	}
781103
async function createDispatcher(options={}){

    // merge options
    const opt = {
        template: options.template || _path.join(__dirname, '../assets/template.ejs'),
        css: options.css || _path.join(__dirname, '../assets/layout.css'),
        lang: options.lang || 'en_US',
        footer: options.footer || null
    };

    // load page template
    const tpl = await _fs.readFile(opt.template, 'utf8');

    // load styles
    const css = await _fs.readFile(opt.css, 'utf8');
    
    // load page definitions
    const pages = await _jsonReader(_path.join(__dirname, '../i18n/pages-' + opt.lang + '.json'));

    // multi-type support
    // @see https://github.com/expressjs/express/blob/master/examples/error-pages/index.js
    return function dispatchRequest(page, httpStatusCode, req, res){
        // page available ?
        if (!pages[page]){
            // use "internal server error" as default
            page = '500';
            httpStatusCode = null;
        }

        // set http status code
        res.status(httpStatusCode || 500);

        // extract page date
        const pageData = pages[page];

        // multiple response formats
        res.format({
            // standard http-error-pages
            html: function(){
                res.type('.html');
                res.send(_render(tpl, css, {
                    code: httpStatusCode,
                    title: pageData.title,
                    message: pageData.message,
                    footer: opt.footer
                }))
            },

            // json
            json: function(){
                res.json({
                    error: pageData.title + ' - ' + pageData.message
                })
            },

            // text response
            default: function(){
                // plain text
                res.type('.txt').send(pageData.title + ' - ' + pageData.message);
            }
        })
    }
}
966084
function (events) {
        "use strict";
    
        onError(events);
    
        // register the paths of the imported libraries by the application
        var hosts = beyond.hosts;
        var paths = {};
        var host;
    
        if (hosts.application && typeof hosts.application.js === 'string') {
    
            if (location.protocol === 'file:') {
                host = hosts.application.js;
                if (!host) {
                    host = '.';
                }
            }
            else {
                host = location.origin + hosts.application.js;
            }
    
            // Remove the last '/' of the host
            if (host.substr(host.length - 1) === '/') {
                host = host.substr(0, host.length - 1);
            }
    
            paths.application = host;
    
        }
    
        for (var name in hosts.libraries) {
    
            var library = hosts.libraries[name];
    
            if (location.protocol === 'file:') {
                host = library.js;
            }
            else {
                host = location.origin;
                host += (library.js.substr(0, 1) !== '/') ? '/' : '';
                host += library.js;
            }
    
            // Remove the last '/' of the host
            if (host.substr(host.length - 1) === '/') {
                host = host.substr(0, host.length - 1);
            }
    
            paths['libraries/' + name] = host;
    
        }
    
        requirejs.config({'paths': paths});
    
        Object.defineProperty(this, 'paths', {
            'get': function () {
                return requirejs.s.contexts._.config.paths;
            }
        });
    
    }
7542
function bundle(input, nc, options, complete) {
  const bundlePath = path.join(nc, 'lib', 'nexe.js');
  const mapfile = options.output + '.map';
  let ws = fs.createWriteStream(bundlePath);

  const igv = '__filename,__dirname,_process';
  let insertGlobalVars = { isNexe: true },
    wantedGlobalVars = igv.split(',');

  // parse insertGlobalVars.
  Object.keys(insertGlobals.vars).forEach(function(x) {
    if (wantedGlobalVars.indexOf(x) === -1) {
      insertGlobalVars[x] = undefined;
    }
  });

  let paths = [path.join(nc, 'lib')];

  if (options.browserifyPaths) {
    paths = paths.concat(options.browserifyPaths);
  }

  _log('executing browserify via API');
  let bproc = browserify([input], {
    debug: options.debug,
    commondir: false,
    paths: paths,
    builtins: false,
    insertGlobalVars: insertGlobalVars,
    detectGlobals: true,
    browserField: false,
  });

  if (options.browserifyExcludes && Array.isArray(options.browserifyExcludes)) {
    for (let i = 0; i < options.browserifyExcludes.length; i++) {
      let lib = options.browserifyExcludes[i];
      _log("Excluding '%s' from browserify bundle", lib);
      bproc.exclude(lib);
    }
  }

  // copy the excludes code for requires for now.
  if (options.browserifyRequires && Array.isArray(options.browserifyRequires)) {
    for (let i = 0; i < options.browserifyRequires.length; i++) {
      let lib = options.browserifyRequires[i];
      let name = lib.file || lib; // for  object format.
      // if `lib` is object then fetch all params without `file`
      // otherwise returns empty object
      let opts =
        (lib instanceof Object &&
          Object.keys(lib)
            .filter(key => key !== 'file')
            .reduce((acc, key) => {
              return (acc[key] = lib[key]), acc;
            }, {})) ||
        {};

      _log("Force including '%s' in browserify bundle", name);
      bproc.require(lib, opts);
    }
  }

  if (options.debug) {
    bproc.require(require.resolve('source-map-support'));
  }

  let bprocbun = bproc
    .bundle() // bundle
    .pipe(ws); // pipe to file

  // error on require errors, still can't contionue. ffs browserify
  bprocbun.on('error', function(err) {
    _log('error', '[browserify] ' + err);
  });

  ws.on('error', function(err) {
    console.log(err);
    _log('error', 'Failed to save stdout to disk');
    process.exit(1);
  });

  ws.on('close', function() {
    var source = fs.readFileSync(bundlePath, 'utf8');
    source = source.replace(/[^\x00-\x7F]/g, '');

    // write the source modified to nexe.js
    fs.writeFile(bundlePath, source, 'utf8', function(err) {
      if (err) {
        _log('error', 'failed to save source');
        process.exit(1);
      }

      complete();
    });
  });
}