
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
easy2command
Advanced tools
A helper package for creating CLI applications using Commander.js and Inquirer.js.
A helper package for creating CLI applications using Commander.js and Inquirer.js.
Easy2Command makes it easy to load and execute commands from a directory of JavaScript files, and automatically creates an interactive menu for users to choose from.
npm install commandhelper
Create a folder named 'commands' in your project, and add command files with a default exported class. Each command class should have a 'name', 'description', and a 'run' method. For example:
// commands/hello.js
class HelloCommand {
constructor() {
this.name = 'hello';
this.description = 'Say hello';
}
async run() {
console.log('Hello, world!');
}
}
export default HelloCommand;
Then, in your main application file, import the CommandHelper package and use it like this:
import CommandHelper from 'commandhelper';
(async () => {
const commandHelper = new CommandHelper();
commandHelper.setCommandDir('./commands');
await commandHelper.registerAllCommands();
await commandHelper.displayInteractiveMenu();
})();
Now, when you run your application, CommandHelper will automatically load all commands from the 'commands' folder and display an interactive menu for users to choose from.
MIT
FAQs
> :warning: Only for local use. Lack of basic security checks.
The npm package easy2command receives a total of 0 weekly downloads. As such, easy2command popularity was classified as not popular.
We found that easy2command 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
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.