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

shell

Package Overview
Dependencies
Maintainers
0
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

shell

Command line arguments parser and stringifier

  • 0.11.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2.7K
decreased by-45.03%
Maintainers
0
Weekly downloads
 
Created
Source

Shell.js argument parser and router for Node.js

This project demonstrates the usage of the Shell library for creating command-line tools that parse arguments and route function calls based on those arguments. The Shell library uses a declarative syntax and allows you to build powerful and user-friendly command-line interfaces in Node.js.

Please start the tutorial and refer to the project website to access the documentation.

Features

  • Reversibility, argument parser and stringifier
  • Auto-discovery, extract unregistered options
  • Standard and commands-based command lines (eg git pull ...)
  • Unlimited/multi level commands (eg myapp server start ...)
  • Type conversion ('string', 'boolean', 'integer', 'array')
  • Object literals, config and parsed results are serializable and human readable
  • Routing, run asynchronous functions or modules based on user commands
  • Auto-generated help
  • Complete tests coverages and samples

Prerequisites

  • Node.js (version 20 or later)
  • A Node Package Manager

Installation

To use Shell.js in your project, you need to install it.

npm install shell

The package export the shell function.

import { shell } from "shell";

shell({
  name: "myapp",
  description: "My CLI application",
  options: {
    config: {
      shortcut: "c",
      description: "Some option",
    },
  },
  commands: {
    start: {
      description: "Start something",
    },
  },
}).route();

Keywords

FAQs

Package last updated on 04 Aug 2024

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