Socket
Socket
Sign inDemoInstall

sacli

Package Overview
Dependencies
0
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    sacli

Elegant type-safe CLI builder for Node.js


Version published
Weekly downloads
8
decreased by-20%
Maintainers
1
Install size
13.5 kB
Created
Weekly downloads
 

Readme

Source

sacli

Elegant and modern CLI builder for Node.js applications.

Features

  • Multiple commands at any depth.
  • Automatic nicely formatted command help.
  • Type safe across commands.

Get it now:

npm i sacli

Example

const git = Command.new()
  .optional("dir", String)
  .required("id", Number)
  .repeated("flags", String);

git
  .subcommand("status")
  .boolean("verbose", {description: "Show full details"})
  .repeated("folders", String, {alias: "F"})
  .repeated("files", String, {default: true})
  .action((args) => {
    args.dir === undefined;
    args.id === 78;
    args.flags.length === 0;
    args.verbose === false;
    arrayEquals(args.folders, ["a/", "b/"]);
    arrayEquals(args.files, ["a", "b", "c"]);
  });

git.eval(["--id", "78", "status", "-F", "a/", "b/", "--", "a", "b", "c"]);

Keywords

FAQs

Last updated on 28 Feb 2022

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc