🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis →
Socket
Book a DemoInstallSign in
Socket

aliases

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

aliases

Parse flag aliases in CLI help output

latest
Source
npmnpm
Version
2.0.0
Version published
Weekly downloads
168
229.41%
Maintainers
1
Weekly downloads
 
Created
Source

aliases

Parse flag aliases in CLI help output

Install

$ npm install aliases

Usage

import aliases from 'aliases';

const help = `
	Usage
	  $ unicorn <name>

	Options
	  -r, --rainbow  Lorem ipsum dolor sit amet
	  -m, --magic    Aenean commodo ligula eget dolor
`;

aliases(help, {h: 'help'});
/*
{
	r: 'rainbow',
	m: 'magic',
	h: 'help'
}
*/

The result can be passed directly to the minimist alias option or used in meow with some effort.

API

aliases(input, extras?)

input

Type: string

CLI help output.

extras

Type: object

Extra aliases to mix into the result.

  • parse-help - Parse CLI help output

Keywords

parse

FAQs

Package last updated on 09 Apr 2021

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