kawkab-frontend
Version:
Kawkab frontend is a frontend library for the Kawkab framework
13 lines (12 loc) • 500 B
JavaScript
import { generateFile } from '../utils/stub.js';
export function makeMiddlewareCommand(program) {
program
.command('make:middleware [path] [module]')
.description('Create a new middleware file in a specific path')
.action((targetPath = '', module = 'main') => {
const filePath = targetPath
? `app/${module}/pages/${targetPath}/middleware.ts`
: `app/${module}/middleware.ts`;
generateFile('middleware.stub', filePath, {});
});
}