How to use the hygen.runner function in hygen

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

github mAAdhaTTah / brookjs / packages / brookjs-cli / src / commands / NewCommand / exec.ts View on Github external
return Kefir.stream(emitter => {
        runner(argv, {
          // NOTE: This is relative to dist, where the build result is.
          templates: path.join(__dirname, '..', 'templates'),
          cwd: state.cwd,
          logger: new Logger(emitter),
          createPrompter: () => inquirer,
          exec: (action, body) => {
            const opts = body && body.length > 0 ? { input: body } : {};
            return execa(action, { ...opts, shell: true });
          },
          debug: false
        })
          .then(result => {
            emitter.value({ type: 'CREATED', payload: { result } });
          })
          .catch(error => {
            emitter.value({ type: 'FAILED', error: true, payload: { error } });

hygen

The scalable code generator that saves you time.

MIT
Latest version published 20 days ago

Package Health Score

85 / 100
Full package analysis

Similar packages