Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
@glyph-cat/cli-parameter-parser
Advanced tools
Readme
--anything
.-a
.2
.process.argv
.const [_ignore0, _ignore1, ...rawParameters] = process.argv
const parameters = new ParameterParser(rawParameters)
getOne
someCommand --anything foo -x abc
or:
someCommand -a foo -x abc
const parameters = new ParameterCollection(rawParameters)
const anything = parameters.getOne('a', 'anything')
console.log(anything) // foo
getBoolean
boolean
.true
are -a
, -a true
, -a t
, -a yes
, -a y
, -a 1
, given that -a
is the alias of the parameter.someCommand --anything
const parameters = new ParameterCollection(rawParameters)
const input = parameters.getBoolean('a', 'anything')
console.log(input) // true
getArray
someCommand -a foo bar --anything baz -b abc -a qux
const parameters = new ParameterCollection(rawParameters)
const inputs = parameters.getArray('a', 'anything')
console.log(inputs) // ['foo', 'bar', 'baz', 'qux']
getTrailing
getArray
whenever possible for more flexibility.someCommand -x aaa -y bbb -z ccc -a foo bar baz
const parameters = new ParameterCollection(rawParameters)
const inputs = parameters.getTrailing('a', 'anything')
console.log(inputs) // ['foo', 'bar', 'baz']
getRemaining
someCommand -a foo -b bar
const parameters = new ParameterCollection(rawParameters)
const anything = parameters.getOne('a', 'anything')
const strayParameters = parameters.getRemaining()
console.log(strayParameters) // ['-b', 'bar']
FAQs
A simple parameter parser for NodeJS CLI applications.
The npm package @glyph-cat/cli-parameter-parser receives a total of 2 weekly downloads. As such, @glyph-cat/cli-parameter-parser popularity was classified as not popular.
We found that @glyph-cat/cli-parameter-parser demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
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.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.