How to use azk - 10 common examples

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 / manifest / index.js View on Github external
getSystemsByName(names) {
    var systems_name = this.systemsInOrder();

    if (!_.isEmpty(names)) {
      names = _.isArray(names) ? names : names.split(',');
      _.each(names, (name) => this.system(name, true));
      systems_name = _.intersection(systems_name, names);
    }

    return _.reduce(systems_name, (systems, name) => {
      systems.push(this.system(name, true));
      return systems;
    }, []);
  }
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);
      }
    });
  }
github azukiapp / azk / spec / generator / rules / generation / mysql_gen_spec.js View on Github external
var generateAndReturnManifest = (project) => {
    var manifest = path.join(project, config('manifest'));
    return generator.findSystems(project).then(function (all_systems) {
      return generator.render({ systems: all_systems }, manifest).then(function() {
        return new Manifest(project);
      });
    });
  };
github azukiapp / azk / spec / generator / rules / generation / node_gen_spec.js View on Github external
var generateAndReturnManifest = (folder) => {
    var manifest = path.join(folder, config('manifest'));
    return generator.findSystems(folder).then(function (all_systems) {
      return generator.render({ systems: all_systems }, manifest).then(function() {
        return new Manifest(folder);
      });
    });
  };
github azukiapp / azk / spec / generator / index_spec.js View on Github external
var generate_manifest = (dir, data) => {
      var file = path.join(dir, config('manifest'));
      return generator.render(data, file).then(function() {
        var manifest = new Manifest(dir);
        return manifest;
      });
    };
github azukiapp / azk / spec / generator / rules / generation / two_node_gen_spec.js View on Github external
var generateAndReturnManifest = (project) => {
    var manifest = path.join(project, config('manifest'));
    generator.render({
      systems: generator.findSystems(project),
    }, manifest);
    return new Manifest(project);
  };
github azukiapp / azk / spec / generator / rules / generation / mysql_and_postgres_gen_spec.js View on Github external
var generateAndReturnManifest = (project) => {
    var manifest = path.join(project, config('manifest'));
    return generator.findSystems(project)
    .then(function (all_systems) {
      return generator.render({ systems: all_systems }, manifest)
      .then(function() {
        return new Manifest(project);
      });
    });
  };

azk

ISC
Latest version published 7 years ago

Package Health Score

40 / 100
Full package analysis

Similar packages