
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.
cmd-funk-hello
Advanced tools
This is a small command line tool built with cmd-funk.
While you could install this globally, its probably more helpful to just clone it and play around...
# If you haven't yet, install yarn
npm install -g yarn
# Clone the repo
git clone https://github.com/Fuiste/cmd-funk-hello.git
cd cmd-funk-hello
This is the full hello world CLI:
import {
SimpleCommandMap,
Marshallers,
SimpleCommand,
Logger,
handleCommand,
} from "cmd-funk";
const sayHello = (cmd: SimpleCommand) => {
Logger.debug(`Running command ${cmd.cmd}`);
return "Hello World";
};
const BaseCommandMap: SimpleCommandMap = {
hello: cmd => Marshallers.str(sayHello(cmd)),
help: () =>
Marshallers.help({
hello: "Says hello",
}),
};
Logger.greet("Howdy");
handleCommand(BaseCommandMap);
Try running the following commands from inside the repo folder:
yarn
yarn build
yarn start hello
yarn start help
yarn start hello --silent
yarn start hello --outFile testFile
cat testFile
This is a very general overview, see the main repo for more info.
These are mappings from commands to their implementation. They must include a help
key, which provides some info about the operation of the command line.
handleCommand
callThis is the most basic function of cmd-funk
. It takes only a command map and an optional custom context, then parses and runs the command for you, calling a default output handler.
Logger
This is a logger provided by cmd-funk
. It automatically silences itself when necessary, and uses a unified color scheme and format
FAQs
A cmd-funk hello world
The npm package cmd-funk-hello receives a total of 2 weekly downloads. As such, cmd-funk-hello popularity was classified as not popular.
We found that cmd-funk-hello 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.