Socket
Socket
Sign inDemoInstall

parse-help

Package Overview
Dependencies
3
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    parse-help

Parse CLI help output


Version published
Weekly downloads
169K
decreased by-16.01%
Maintainers
1
Install size
20.4 kB
Created
Weekly downloads
 

Readme

Source

parse-help

Parse CLI help output

Install

$ npm install parse-help

Usage

import parseHelp from 'parse-help';

const help = `
	Usage
	  $ unicorn <name>

	Options
	  --rainbow    Lorem ipsum dolor sit amet
	  -m, --magic  Aenean commodo ligula eget dolor
	  --pony       Nullam dictum felis eu pede
	  -c, --color  Donec quam felis

	Examples
	  $ unicorn Peachy
	  $ unicorn Sparkle --rainbow --magic
`;

parseHelp(help);
/*
{
	flags: {
		rainbow: {
			description: 'Lorem ipsum dolor sit amet'
		},
		magic: {
			alias: 'm',
			description: 'Aenean commodo ligula eget dolor'
		},
		pony: {
			description: 'Nullam dictum felis eu pede'
		},
		color: {
			alias: 'c',
			description: 'Donec quam felis'
		}
	},
	aliases: {
		m: 'magic',
		c: 'color'
	}
}
*/
  • aliases - Parse flag aliases in CLI help output

Keywords

FAQs

Last updated on 08 Apr 2021

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