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.
@keg-hub/cli-utils
Advanced tools
Utility methods for writing Custom Tasks consumed by the Keg-CLI
Common utility methods shared across Keg-Hub and Tap repos
With yarn
yarn add @keg-hub/cli-utils
With npm
npm install @keg-hub/cli-utils
runTask
- Find and execute a custom task
keg-cli
package.json
under the scripts
property
yarn
or npm
like this =>
// taps package.json file
"scripts": {
// ...other scripts
"task": "node ./node_modules/@keg-hub/cli-utils/src/runTask.js",
}
yarn task <task-name> <task-options>
start
task definition exists, running yarn task start
will call that task // package.json file
"scripts": {
// ...other scripts
"task": "node ./tasks/runTask.js",
}
// tasks/runTask.js file
const { runTask } = require('@keg-hub/cli-utils')
// Run some other logic prior to running a task
runTask()
~/.kegConfig/cli.config.json
if it existsoptions
property
params
key of the args
objectkeg-cli
keg-cli
setAppRoot
- Register a taps root directory
keg-cli
, the setAppRoot
method is NOT neededkeg-cli
will automatically find the root of a linked tap
keg tap link <tap-name>
from the taps rootkeg-cli
tasks will already know the taps root directorykeg-cli
, calling this method is highly recommended
mono-repo
or sym-linked
situations, the tap root can be properly resolvedtasks/index.js
file like this =>
const { setAppRoot } = require('@keg-hub/cli-utils')
setAppRoot(appRoot)
module.exports = { customTask: { ...taskDefinition } }
tasks/index.js
file for an exampleregisterTasks
- Register Custom Tasks
keg-cli
will automatically load custom tasks for a linked tap
tasks
folder in the root directorytasks
folder must have an index.js
registerTasks
is NOT needed
tasks
folder is NOT possiblekeg-cli
command for the tasks to be found
Object
argument that should contain key/value pairs task name/definitions
For example => registerTasks({ taskName: { ...taskDefinition } })
TODO: Add docs for exported utility methods
FAQs
Utility methods for writing Custom Tasks consumed by the Keg-CLI
The npm package @keg-hub/cli-utils receives a total of 1,009 weekly downloads. As such, @keg-hub/cli-utils popularity was classified as popular.
We found that @keg-hub/cli-utils 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.