Skip to content

Commit

Permalink
feat: Add processTitle
Browse files Browse the repository at this point in the history
feat: Accept a callback for launch function
  • Loading branch information
Tyler Kellen authored and phated committed Nov 21, 2021
1 parent 2c02974 commit bc8e5ab
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ var util = require('util');
var path = require('path');
var EventEmitter = require('events').EventEmitter;
var zipObject = require('lodash.zipobject');

var findup = require('findup-sync');
var findCwd = require('./lib/find_cwd');
var findLocal = require('./lib/find_local');
Expand All @@ -14,6 +13,7 @@ function Liftoff (opts) {
if(!Array.isArray(this.localDeps)) {
this.localDeps = [this.localDeps];
}
this.processTitle = opts.processTitle;
this.configName = opts.configName;
this.cwdOpt = opts.cwdOpt||'cwd';
this.requireOpt = opts.requireOpt||'require';
Expand Down Expand Up @@ -46,7 +46,9 @@ Liftoff.prototype.requireLocal = function (dep, mute) {
}
};

Liftoff.prototype.launch = function () {
Liftoff.prototype.launch = function (fn) {
// set the process title
process.title = this.processTitle;
// parse cli
this.args = require('optimist').argv;
// get cwd
Expand Down Expand Up @@ -75,8 +77,7 @@ Liftoff.prototype.launch = function () {
return findLocal(dep, this.configBase);
}, this));
}
// kick it off!
this.emit('run');
fn.apply(this);
};

module.exports = Liftoff;

0 comments on commit bc8e5ab

Please sign in to comment.