
Security News
TypeScript is Porting Its Compiler to Go for 10x Faster Builds
TypeScript is porting its compiler to Go, delivering 10x faster builds, lower memory usage, and improved editor performance for a smoother developer experience.
Using yarn:
$ yarn add daph
Using npm:
$ npm install daph
daph
.createCommand(ICommand, callback(commandName, args) => unknown) // create command
.createCommand(ICommand, callback(commandName, args) => unknown) // create another command
.help() // If none of the above commands are used, execute the help command.
ICommand
: Where command is defined to be used when separating arguments. Structure:{
name: "test", // Command name
usage: "--message <your_message>", // Command usage
example: [ "--message Hello, world!", "-m Test message" ], // Usage examples
category: "test", // Command category
aliases: [ "t" ], // Command aliases
description: "just a test command", // Command description
argDefinitions: [
{ name: "message", type: String, aliases: [ "m" ] }
] // Arg definition array (Learn about ArgDefinition below)
}
ArgDefinition
: Where options are defined to be used when separating arguments. Structure:{
name: "message", // Option name
type: String // Option type (function)
aliases?: [ "m" ], // Option aliases (optional)
default?: false, // optional
isOptional?: false // optional
}
callback(commandName, args) => unknown
: If the command you set is used, the action to be applied. Example:daph.createCommand(ICommand, (commandName, args) => { // callback(commandName, args) ⬇️
console.log("You used", commandName, "command with arguments", args);
});
import daph from "daph";
daph
.createCommand({
name: "install",
usage: "<module_name> [--version] <package_version>",
example: [ "daph", "bargs --version 1.0.1" ],
category: "utility",
aliases: [ "i", "add" ],
description: "Install packages from server",
argDefinitions: [
{ name: "module", type: String, default: true },
{ name: "version", type: String, isOptional: true }
]
}, (commandName, args) => {
const { module, version } = args;
console.log("You have downloaded package", module, "with version" version ? version : "latest");
})
.help()
Feel free to use GitHub's features ✨
FAQs
✨ A simple CLI commander system
The npm package daph receives a total of 2 weekly downloads. As such, daph popularity was classified as not popular.
We found that daph 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
TypeScript is porting its compiler to Go, delivering 10x faster builds, lower memory usage, and improved editor performance for a smoother developer experience.
Research
Security News
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
Security News
Socket CEO Feross Aboukhadijeh discusses the open web, open source security, and how Socket tackles software supply chain attacks on The Pair Program podcast.