How to use the azk.lazy_require 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 / spec / sync / watcher_spec.js View on Github external
import h from 'spec/spec_helper';
import { _, path, lazy_require, fsAsync } from 'azk';
import { all } from 'azk/utils/promises';

var lazy = lazy_require({
  Watcher: ['azk/sync/watcher'],
  Sync   : ['azk/sync'],
  semver : 'semver'
});

describe("Azk sync, Watcher module", function() {
  this.timeout(20000);

  var watcher;
  var example_fixtures = h.fixture_path('sync/test_1/');

  function make_copy() {
    return all([
      h.copyToTmp(example_fixtures),
      h.tmp_dir()
    ]);
github azukiapp / azk / src / sync / worker.js View on Github external
import { _, lazy_require, path, log, fsAsync } from 'azk';
import { defer, async } from 'azk/utils/promises';

var lazy = lazy_require({
  Sync    : ['azk/sync'],
  chokidar: 'chokidar'
});

export class Worker {
  constructor(process) {
    this.process = process;
    this.process.on('message', (data) => {
      process.title = "azk sync worker " + data.origin + " " + data.destination;
      this.watch(data.origin, data.destination, data.opts).then(() => {}, () => {});
    });

    this.chok = null;
  }

  watch(origin, destination, opts = {}) {
github azukiapp / azk / spec / sync / worker_spec.js View on Github external
import h from 'spec/spec_helper';
import { _, path, lazy_require, fsAsync } from 'azk';
import { defer, async, all } from 'azk/utils/promises';

var lazy = lazy_require({
  Sync         : ['azk/sync'],
  Worker       : ['azk/sync/worker'],
  EventEmitter : ['events'],
  semver       : 'semver'
});

describe("Azk sync, Worker module", function() {
  this.timeout(20000);

  var worker;
  var example_fixtures = h.fixture_path('sync/test_1/');
  var invalid_fixtures = path.join(h.fixture_path('sync/test_1/'), 'invalid');

  function make_copy() {
    return all([
      h.copyToTmp(example_fixtures),
github azukiapp / azk / src / system / run.js View on Github external
import { _, t, lazy_require, isBlank } from 'azk';
import { config, log, path } from 'azk';
import { subscribe, publish } from 'azk/utils/postal';
import { defer, async, asyncUnsubscribe, promiseResolve, thenAll } from 'azk/utils/promises';
import { ImageNotAvailable, SystemRunError, RunCommandError, NotBeenImplementedError } from 'azk/utils/errors';
import { Balancer } from 'azk/system/balancer';
import net from 'azk/utils/net';

var lazy = lazy_require({
  MemoryStream: 'memorystream',
  docker      : ['azk/docker', 'default'],
  Client      : ['azk/agent/client'],
  colors      : ['azk/utils/colors'],
});

var Run = {
  runProvision(system, options = {}) {
    return async(this, function* () {
      var steps = system.provision_steps;

      options = _.clone(options);
      options = _.defaults(options, {
        provision_force: false,
        build_force: false,
        provision_verbose: false,
github azukiapp / azk / src / cmds / shell.js View on Github external
import { CliTrackerController } from 'azk/cli/cli_tracker_controller';
import { Helpers } from 'azk/cli/helpers';
import { _, config, lazy_require } from 'azk';
import { defer, asyncUnsubscribe } from 'azk/utils/promises';
import { subscribe } from 'azk/utils/postal';

var lazy = lazy_require({
  Manifest: ['azk/manifest'],
  docker  : ['azk/docker', 'default'],
});

export default class Shell extends CliTrackerController {
  index() {
    var { options } = this.normalized_params;
    var args = this.normalized_params.arguments;

    var _subscription = subscribe('docker.pull.status', (data) => {
      this.view('image_pull').render(data);
    });

    return asyncUnsubscribe(this, _subscription, function* () {
      var dir = this.cwd;
      var manifest, system;

azk

ISC
Latest version published 7 years ago

Package Health Score

40 / 100
Full package analysis

Similar packages