@js-migrations/commander
CLI presenter for JS Migrations
Last updated 2 years ago by ryansmith94 .
GPL-3.0 · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @js-migrations/commander 
SYNC missed versions from official npm registry.

commander

CLI presenter for JS Migrations

Usage

  1. Install it with npm i @js-migrations/commander.
  2. Create the service facade with @js-migrations/core.
  3. Use the factory to create the presenter facade.
  4. Use the CLI.

Use the factory

import commanderMigrationsPresenterFactory from '@js-migrations/commander/dist/factory';
import { Command } from 'commander';

const program = new Command();
const migrationsRepoFacade = commanderMigrationsPresenterFactory({
  // Optional property to exit when migrations are completed. Defaults to `process.exit`.
  exitProcess: () => {
    process.exit();
  },
  // Optional property to handle migration errors. Defaults to "utils/handleError".
  handleError: (err) => {
    console.error(err);
  },
  // Optional property to log output. Defaults to "utils/defaultLog".
  log: (status) => {
    console.log(status);
  },
  program,
  service: migrationsServiceFacade,
});
program.parse(process.argv);

Use the CLI

If you placed the code to use the factory in "./cli.js" you can use the CLI by running node ./cli.js --help. This package contains a demo file showing how this can be used together.

Current Tags

  • 2.0.9                                ...           latest (2 years ago)

13 Versions

  • 2.0.9                                ...           2 years ago
  • 2.0.8                                ...           2 years ago
  • 2.0.7                                ...           2 years ago
  • 2.0.6                                ...           2 years ago
  • 2.0.5                                ...           2 years ago
  • 2.0.4                                ...           2 years ago
  • 2.0.3                                ...           2 years ago
  • 2.0.2                                ...           2 years ago
  • 2.0.1                                ...           2 years ago
  • 2.0.0                                ...           2 years ago
  • 1.2.0                                ...           2 years ago
  • 1.1.0                                ...           2 years ago
  • 1.0.0                                ...           2 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 2
Dependencies (4)
Dev Dependencies (13)
Dependents (1)

Copyright 2014 - 2016 © taobao.org |