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

@ionic/cli-framework

Package Overview
Dependencies
Maintainers
19
Versions
203
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ionic/cli-framework

The foundation framework of the Ionic CLI

  • 3.0.4
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
93K
decreased by-14.27%
Maintainers
19
Weekly downloads
 
Created
Source

CLI Framework, by Ionic

The foundation framework of the Ionic CLI.

Getting Started

index.js:

const { Command, CommandMap, Namespace, execute } = require('@ionic/cli-framework');

class VersionCommand extends Command {
  async getMetadata() {
    return {
      name: 'version',
      summary: 'Print CLI version',
    };
  }

  async run() {
    console.log('1.0.0');
  }
}

class RootNamespace extends Namespace {
  async getMetadata() {
    return {
      name: 'mynewcli',
      summary: 'A cool CLI that prints its own version',
    };
  }

  async getCommands() {
    return new CommandMap([['version', async () => new VersionCommand(this)]]);
  }
}

module.exports = async function(argv, env) {
  await execute({ namespace: new RootNamespace(), argv, env });
}

bin/mynewcli:

#!/usr/bin/env node

const run = require('../');
run(process.argv.slice(2), process.env);

command line:

$ ./bin/mynewcli
$ ./bin/mynewcli version
$ ./bin/mynewcli version --help

FAQs

Package last updated on 05 Dec 2019

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