Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

cav

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cav

[![npm version](https://badge.fury.io/js/cav.svg)](https://badge.fury.io/js/cav)

  • 0.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
Maintainers
1
Weekly downloads
 
Created
Source

cav

npm version

A supporter for making your CLI.

Install

$ npm i -S cav

Examples

#!/usr/bin/env node

// sample-cli

const Cav = require('cav');
const packageJson = require('./package.json');

const commands = {
  'deploy <to> <env>'            : 'Deploy to ec2.',
  'migrate <from> <to> <version>': 'Migrate data.',
  '-f'                           : '✊',
  '-c, --current-state'          : 'Show Current State.'
};

const cav = new Cav(commands, packageJson);

cav.start((args) => {
  console.log(args)
});

Parse arguments

$ sample-cli deploy japan prod -f -c ok
cav.start((args) => {
  console.log(JSON.stringify(args, null, 2));
  //  {
  //    "commands": {
  //      "deploy": {
  //        "to": "japan",
  //        "env": "prod"
  //      }
  //    },
  //    "options": {
  //      "f": true,
  //      "c": "ok"
  //    }
  //  }
});

help

Version:    1.0.0

Usage:      sample-cli <commands> <options>

Commands:
            deploy <to> <env>                 Deploy to ec2.
            migrate <from> <to> <version>     Migrate data.
Options:
            -v, --version                     Display version.
            -h, --help                        Display help.
            -f                                ✊
            -c, --current-state               Show Current State.

Keywords

FAQs

Package last updated on 05 May 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc