@amedia/kragl-utils
v3.2.1
Published
Utility functions for Kragl
Maintainers
Keywords
Readme
@amedia/kragl-utils
Internal helpers shared across kragl runners — config discovery, task
plumbing, child-process execution, logging, plugin auto-loading, and a small
glob walker built on node:fs.
This is an internal package. Stable API is not promised between minor versions. Consumers should generally depend on
@amedia/kraglinstead.
Install
npm install --save-dev @amedia/kragl-utilsUse
import { makeTask, runTask, hasConfig, paths, log } from '@amedia/kragl-utils';The full export surface is in index.js. The most commonly
referenced helpers when writing a new kragl-* runner:
makeTask(name, opts)/runTask(runner, task)— task plumbing.hasConfig([...patterns])— detect whether the consuming repo provides its own config file.paths(import.meta.url)— resolveTHIS_ROOT(the runner's package dir) andCONSUMING_ROOT(the project being linted).run(cmd, args, opts)— run a subprocess with kragl's logging conventions.log— kragl's quiet/verbose-aware logger.
Notes
Requires Node 22+. Tests run with the built-in node:test runner:
npm test -w @amedia/kragl-utils