![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
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 2 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.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.