How to use the azk._.each function in azk

To help you get started, we’ve selected a few azk 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 azukiapp / azk / src / cli / cli.js View on Github external
__load_cmds(cwd) {
    var cmds = lazy.glob("*.js", { cwd: cwd });
    _.each(cmds, (cmd) => {
      require(path.join(cwd, cmd)).init(this);
    });
  }
github azukiapp / azk / src / manifest / system.js View on Github external
_envs_from_file() {
    var envs = {};
    var file = path.join(this.manifest.manifestPath, '.env');

    if (fs.existsSync(file)) {
      var content = fs.readFileSync(file).toString();
      _.each(content.split('\n'), (entry) => {
        if (entry.match(/.*=.*/)) {
          entry = entry.split('=');
          envs[entry[0]] = entry[1];
        }
      });
    }

    return envs;
  }
}
github azukiapp / azk / src / generator / court.js View on Github external
load(dir) {
    _.each(glob.sync(path.join(dir, '**/*.js')), (file) => {
      var Rule = require(file).Rule;
      if (Rule) {
        var rule = new Rule(this);
        if (_.isArray(this.__rules[rule.type])) {
          rule.name = path.basename(file, '.js');
          this.__rules[rule.type].push(rule);
        }
      }
    });
  }
github azukiapp / azk / src / cli / command.js View on Github external
valid_requires(opts) {
    var filter = (opt) => { return opt.required; };
    var requireds = _.filter(this.options, filter);
    requireds = requireds.concat(_.filter(this.stackable, filter));

    _.each(requireds, (option) => {
      if (!opts[option.name]) {
        throw new RequiredOptionError(option.name);
      }
    });
  }

azk

ISC
Latest version published 7 years ago

Package Health Score

40 / 100
Full package analysis

Similar packages