Socket
Socket
Sign inDemoInstall

@types/argparse

Package Overview
Dependencies
0
Maintainers
1
Versions
36
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @types/argparse

TypeScript definitions for argparse


Version published
Weekly downloads
1.7M
decreased by-0.67%
Maintainers
1
Install size
7.85 kB
Created
Weekly downloads
 

Package description

What is @types/argparse?

The @types/argparse package provides TypeScript type definitions for the argparse package, which is a node.js library for parsing command-line options. It allows developers to add options, arguments, and sub-commands in their command-line applications, making it easier to build tools with clear and helpful usage messages. The types provided by @types/argparse ensure that TypeScript developers can use argparse with the benefits of type checks and autocompletion in their IDEs.

What are @types/argparse's main functionalities?

Argument Parsing

This feature allows you to parse command-line arguments. You can define options (like '-v' for verbose output) and then parse the arguments provided to your application. This is useful for creating command-line tools with various options.

{"import { ArgumentParser } from 'argparse';\nconst parser = new ArgumentParser({\n  description: 'Argument parser example'\n});\n\nparser.add_argument('-v', '--verbose', {\n  help: 'increase output verbosity',\n  action: 'store_true'\n});\n\nconst args = parser.parse_args();\nconsole.log(args.verbose);"}

Sub-commands

This feature demonstrates how to use sub-commands in your application, allowing for a more organized and modular command-line interface. Each sub-command can have its own set of arguments.

{"import { ArgumentParser } from 'argparse';\nconst parser = new ArgumentParser({\n  description: 'Sub-command example'\n});\n\nconst subparsers = parser.add_subparsers({\n  title: 'subcommands',\n  dest: 'subcommand_name'\n});\n\nconst start = subparsers.add_parser('start', { add_help: true });\nstart.add_argument('-p', '--port', {\n  help: 'Port to start the server on',\n  default: 8080\n});\n\nconst args = parser.parse_args();\nconsole.log(args);"}

Other packages similar to @types/argparse

Readme

Source

Installation

npm install --save @types/argparse

Summary

This package contains type definitions for argparse (https://github.com/nodeca/argparse).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/argparse.

Additional Details

  • Last updated: Tue, 31 Dec 2019 23:55:49 GMT
  • Dependencies: none
  • Global values: none

Credits

These definitions were written by Andrew Schurman (https://github.com/arcticwaters), Tomasz Łaziuk (https://github.com/tlaziuk), Sebastian Silbermann (https://github.com/eps1lon), Kannan Goundan (https://github.com/cakoose), and Halvor Holsten Strand (https://github.com/ondkloss).

FAQs

Last updated on 31 Dec 2019

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