JSPM

  • Created
  • Published
  • Downloads 82
  • Score
    100M100P100Q68395F
  • License ISC

Lightweight CLI-App Factory based on process-yargs-parser 🚀.

Package Exports

  • cli-aid

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (cli-aid) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

cli-aid

Lightweight CLI-App Factory based on process-yargs-parser 🚀.

npm version npm downloads Install Size jest

Use

github demo/tinify-client-cli.js.

const { CLI } = require('../src');

const pkg = {
  name: 'tinify-client',
  version: '4.3.0',
  description: 'A CLI to compress your images not only intelligently but also to the EXTREME!',
};

new CLI()
  .package(pkg)
  .option('dry-run', { default: false, help: 'Does everything compress would do except actually compressing. Reports the details of what would have been compressed.' })
  .option('max-count', 'm', 'c', { default: 15, help: 'The max compressing turns. Default 15.' })
  .command('base64', {
    usage: 'npx tinify-client base64 IMG_URL_OR_LOCAL_IMG_PATH',
    help: 'Output base64-encoded string of the input image.',
  }, (options) => {
    console.log('output base64 with options:', options);

    process.exit(0);
  })
  .parse(process.argv.slice(2));

node demo/tinify-client-cli.js --h

tinify-client/4.3.0

A CLI to compress your images not only intelligently but also to the EXTREME!

Usage
  tinify-client [OPTIONS]
  npx tinify-client base64 IMG_URL_OR_LOCAL_IMG_PATH

Options
  --help, -h, -docs, -帮助    Show this help information.
  --version, -v               Show the version information.
  --dry-run                   Does everything compress would do except actually compressing. Reports the details of what would have been compressed.
  --max-count, -m, -c         The max compressing turns. Default 15.

node demo/tinify-client-cli.js --v

tinify-client-cli/2.0.0 darwin-x64 node-v12.8.1

READ more options in CLI.test.js and command in demo/tinify-client-cli.js.

TODO

  • cmd options
  • cmd help msg