Security News
The Risks of Misguided Research in Supply Chain Security
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.
Librairie simpliste pour la création de commandes CLI.
import {GCommand, Command, CommandParameters} from "kjscommand/build/index.js";
const param1 = new CommandParameters("param", "p", "Description ici", "defaut");
const param2 = new CommandParameters("superparam", "sp", "Autre description");
const command = new Command("command", "Description de la commande", [param1, param2], function(arg = {param, superparam})
{
console.log("Param1 :" + arg.param + " Param 2 :" + arg.superparam);
}
const gCommand = new GCommand("test", "Description de l'application", [command]);
gCommand.getArguments(process.argv.slice(2));
La commande se décompose comme ceci : test command --param="autre" -sp 12
GCommand
(le nom attribué doit être le même que celui du fichier de préférence)Command
qui est une sous commande de la commande globale--param=[VALEUR]` ou alors sous la forme raccourci
-p 12``Pour récupérer les paramètres il faut simplement définir dans la fonction de callback un premier paramètres qui contiendra tous les paramètres de la commande sous la forme suivante : arg. ( correspond au nom entier du paramètre)
getArguments() prend en paramètre un tableau d'arguments.
FAQs
CLI Creator
We found that kjscommand 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
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.
Research
Security News
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.