Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
This is a very simple CLI argument parser optimized for Daplie style.
The main export is a scan function that expects a process.argv
style array and
returns you processed information such as the command, flags, and positional
args.
$ npm install --save argscan
// Pass the argv to the scan function to get parsed parts
var { command, flags, args } = require('argscan')(process.argv)
// Do logic using command string, flags map, and args list
switch (command) {
case 'greet':
if (flags.loudly) { console.log('HELLO ') }
else { console.log ('hi') }
break
...
}
Daplie style arg parsing means a few assumptions.
First you're expected to have several commands with optional :
namespacing.
For example yourprogram action:subaction
where action:subaction
is the
command.
Also both long and short flags are supported. Long flags are expected to always
look like --someFlag
or --key=value
. Short flags are single-character
flags. You can have as many as you want on a single position. For example
-tim
is the same as -t -i -m
. Both will generate a flags map of
{ t: true, i: true, m: true }
.
FAQs
A simple CLI argument parser optimized for daplie style tools.
The npm package argscan receives a total of 0 weekly downloads. As such, argscan popularity was classified as not popular.
We found that argscan demonstrated a not healthy version release cadence and project activity because the last version was released 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.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.