
Research
/Security News
Intercom’s npm Package Compromised in Ongoing Mini Shai-Hulud Worm Attack
Compromised intercom-client@7.0.4 npm package is tied to the ongoing Mini Shai-Hulud worm attack targeting developer and CI/CD secrets.
argv-parser
Advanced tools
Argv-parser is a small and simple node.js module to parser `process.argv`.
Argv-parser is a small and simple node.js module to parse
process.argv
Argv-parser is designed to be simple and will do nothing about:
npm install argv-parser --save
var parser = require('argv-parser');
Parse argument vector (argv) or something like argv.
ret ObjectObject the parsed objectObject the warnings of each option. If not exists, ret.warning will be an empty objectObject the errors of each option.Arrayprocess.argv or something like that.
ObjectObject an extended nopt rulesNumber (optional, default to 2) the offset from which the parser should start to parse.The same as parser.parse
ObjectObjectObject (optional) type definitions. For most cases, you needn't this optiontest.js
var rules = {
open: {
type: Boolean,
value: true
},
port: {
type: Number,
short: 'p',
value: function(port, parsed, tool) {
if(!port){
port = 9230;
}
if(port < 8000){
tool.warn('port < 8000 which is dangerous');
if(port < 1000){
tool.error('port < 100 which is forbidden');
return;
}
}
return port;
}
},
html: {
type: 'html',
},
name: {
type: String
}
};
var data = parser.parse(process.argv, {
rules: rules
});
Default values:
$ node test.js
> data.parsed.open; // true
> data.parsed.port; // 9230
Type limitation:
$ node test.js --port 8888 --no-open --name name<script>alert(123)</script>
> data.parsed.open; // false
> data.parsed.port; // 8888
> data.parsed.name; // 'namealert(123)'; -> stripped
> data.errors; // {}
> data.warnings; // {}
Warnings and errors:
$ node test.js --port 888 --no-open --name name<script>alert(123)</script>
> data.parsed.open; // false
> data.parsed.port; // undefined; -> error
> data.parsed.name; // 'name<script>alert(123)</script>'
> data.errors; // {port: ['port < 100 which is forbidden']}
> data.warnings; // {port: ['port < 8000 which is dangerous']}
FAQs
Argv-parser is a small and simple node.js module to parser `process.argv`.
We found that argv-parser 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
Compromised intercom-client@7.0.4 npm package is tied to the ongoing Mini Shai-Hulud worm attack targeting developer and CI/CD secrets.

Research
Socket detected a malicious supply chain attack on PyPI package lightning versions 2.6.2 and 2.6.3, which execute credential-stealing malware on import.

Research
A brand-squatted TanStack npm package used postinstall scripts to steal .env files and exfiltrate developer secrets to an attacker-controlled endpoint.