
Security News
Next.js Patches Critical Middleware Vulnerability (CVE-2025-29927)
Next.js has patched a critical vulnerability (CVE-2025-29927) that allowed attackers to bypass middleware-based authorization checks in self-hosted apps.
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.
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.
Security News
Next.js has patched a critical vulnerability (CVE-2025-29927) that allowed attackers to bypass middleware-based authorization checks in self-hosted apps.
Security News
A survey of 500 cybersecurity pros reveals high pay isn't enough—lack of growth and flexibility is driving attrition and risking organizational security.
Product
Socket, the leader in open source security, is now available on Google Cloud Marketplace for simplified procurement and enhanced protection against supply chain attacks.