
Research
npm Malware Targets Telegram Bot Developers with Persistent SSH Backdoors
Malicious npm packages posing as Telegram bot libraries install SSH backdoors and exfiltrate data from Linux developer machines.
argz-parser
Advanced tools
A utility module used by CLI tools for parsing arguments. Returns an array of corresponding actions to be taken.
A utility module used by CLI tools for parsing arguments. Returns an array of corresponding actions to be taken.
This module must be passed a config file in order to parse the arguments.
/*
* Config file for dw cli
*
*/
// Dependencies
const pj = require("./package.json");
module.exports = {
version: pj.version,
help: `
Usage:
dw [flag] dw calls the cli options chosen by passing a flag
Options:
-i, --init install a new Devwatch blog in current directory
-h, --help print help menu
-v, --version print current version of kick-init package
-w, --watch watch the project for changes, site recompiles on change
Examples:
# creates a new blog in current directory
$ dw --init
# Print help menu
$ dw -h
`,
flags: [
{
flag: ["-i", "--init"],
action: "init"
},
{
flag: ["-h", "--help"],
action: "help"
},
{
flag: ["-v", "--version"],
action: "version"
},
{
flag: ["-w", "--watch"],
action: "watch"
}
]
};
Install module by running
$ yarn add argz-parser
or
$ npm -i argz-parser
Then call argz-parser passing in the argument list and the config file. This function will return a promise that resolves into an array of string names representing the actions to be taken.
"use strict";
const path = require("path");
const argzParser = require("argz-parser");
const { init } = require("./lib/dwFunctions");
const config = require("./.dwconfig.js");
module.exports = args => {
args = typeof args == "object" ? args : false;
if (args) {
argzParser(args, config).then(args => {
args.map(arg => {
switch (arg) {
case "init":
init(path.join(__dirname, "/bin/setUpApp.sh"), process.cwd());
break;
case "help":
console.log(config.help);
break;
case "watch":
console.log("im watching");
break;
default:
console.log(config.version);
}
});
});
} else {
throw Error(
"\x1b[31m%s\x1b[0m",
"Improper arguments passed to the devwatch cli"
);
}
};
FAQs
A utility module used by CLI tools for parsing arguments. Returns an array of corresponding actions to be taken.
The npm package argz-parser receives a total of 1 weekly downloads. As such, argz-parser popularity was classified as not popular.
We found that argz-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
Malicious npm packages posing as Telegram bot libraries install SSH backdoors and exfiltrate data from Linux developer machines.
Security News
pip, PDM, pip-audit, and the packaging library are already adding support for Python’s new lock file format.
Product
Socket's Go support is now generally available, bringing automatic scanning and deep code analysis to all users with Go projects.