
Security News
Axios Maintainer Confirms Social Engineering Attack Behind npm Compromise
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.
@epdoc/cmdutil
Advanced tools
Commander command line utilities for limited distribution.
npm install
npm run build
import { CmdProps } from '@epdoc/cmdutil';
import pkg from '../package.json';
import { MainCmd, RosGenCmd, RosReadCmd } from './commands';
// import { FileRenameAll } from './commands/rename-all';
// import { FileRenameCamelcase } from './commands/rename-camelcase';
// import { FileRenameDate } from './commands/rename-date';
const mainCmd = new MainCmd(pkg as CmdProps);
mainCmd.addSubCommand(new RosGenCmd());
mainCmd.addSubCommand(new RosReadCmd());
mainCmd.parseArgs();
main-cmd.ts
import { BaseMainCmd } from '@epdoc/cmdutil';
export class MainCmd extends BaseMainCmd {
private _isMain = true;
static isInstance(val: any): val is MainCmd {
return val && val._isMain === true;
}
}
ros-gen-cmd.ts
import { CmdProps, FileBaseCmd, log } from '@epdoc/cmdutil';
import { FSItem, FolderPath } from '@epdoc/fsutil';
import { isNonEmptyArray } from '@epdoc/typeutil';
import { Argument, Option } from 'commander';
import { EnvType, isEnvType, skip } from '../lib';
import { FileOperation } from '../file-operation';
export class RosGenCmd extends FileBaseCmd {
private _isGenRunner = true;
static isInstance(val: any): val is RosGenCmd {
return val && val._isGenRunner === true;
}
constructor() {
super({ name: 'generate', description: 'Generate RSC files from JSON configuration' });
}
getProps(): CmdProps {
return {
aliases: ['gen'],
options: [
new Option('-j --json', 'Also output as JSON'),
new Option('-t --time', 'Include time in filename of output file'),
new Option('--env <env>', 'Set env').default(skip.env),
new Option('--comment <text>', 'Comment to put in header of RSC file'),
new Option('-o --output <path>', 'Output filename. Defaults to same folder as input file')
],
arguments: [new Argument('<files...>', 'List of configuration files')]
};
}
public async run(): Promise<void> {
return Promise.resolve()
.then((resp) => {
if (this.opts.env) {
if (isEnvType(this.opts.env)) {
skip.setEnv(this.opts.env);
} else {
let envs: string[] = Object.keys(EnvType).map((key) => EnvType[key]);
throw new Error(`Invalid env value '${this.opts.env}', must be one of ${envs.join(',')}`);
}
}
return this.getFilesFromArgs(this.parent.opts.pwd as FolderPath, {
levels: 1,
files: true,
folders: false
});
})
.then(async (resp) => {
if (isNonEmptyArray(resp)) {
log.h2(`Generating output from ${resp.length} config files`).trace();
let deviceOpts = {
cwd: this.parent.opts.cwd,
pwd: this.parent.opts.pwd,
json: this.opts.json,
time: this.opts.time,
output: this.opts.output,
comment: this.opts.comment
};
for (let fdx = 0; fdx < resp.length; ++fdx) {
const fs: FSItem = resp[fdx];
log.h2('Generate RSC file for device').path(fs.basename).trace();
const device = new FileOperation(deviceOpts);
await device
.read(fs)
.then((resp) => {
device.initOutput();
return device.generate();
})
.then((resp) => {
return device.write();
})
.then((resp) => {
return Promise.resolve();
});
}
} else {
log.h2('No config files specified').info();
}
});
}
}
FAQs
Commander utility classes and general CLI helpers.
We found that @epdoc/cmdutil demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers 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
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.