How to use the egg-bin.DebugCommand function in egg-bin

To help you get started, we’ve selected a few egg-bin examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github midwayjs / midway / packages / midway-bin / lib / cmd / debug.js View on Github external
'use strict';
const resolver = require('../util').resolveModule;
const co = require('co');

class DebugCommand extends require('egg-bin').DebugCommand {
  constructor(rawArgv) {
    super(rawArgv);
    this.usage = 'Usage: midway-bin debug [dir] [options]';
  }

  async run(context) {
    if (!context.argv.framework) {
      context.argv.framework = this.findFramework('midway') || this.findFramework('midway-mirror');
    }
    await co(super.run(context));
  }

  findFramework(module) {
    return resolver(module);
  }
}

egg-bin

egg developer tool

MIT
Latest version published 11 days ago

Package Health Score

78 / 100
Full package analysis

Popular egg-bin functions

Similar packages