-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathindex.js
executable file
·51 lines (37 loc) · 1.18 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/usr/bin/env node
const { Command } = require("./lib/commander");
const { createApp } = require("./create-app");
const { createController } = require("./create-controller");
const { createModel } = require("./create-model");
const { createModule } = require("./create-module");
const program = new Command()
program.name("Nilajs").description("Nilajs Commands for Express Boilerplate").version("0.0.1")
program
.command("create:app")
.description("Build REST application")
.argument("<appName>", "Application Name")
.action(async (appName) => {
createApp(appName);
})
program
.command("create:controller")
.description("Generate a new controller")
.argument("<controllerName>", "Controller Name")
.action(async (controllerName) => {
createController(controllerName);
});
program
.command("create:model")
.description("Generate a new model")
.argument("<modelname>", "Model Name")
.action(async (modelname) => {
createModel(modelname);
});
program
.command("create:module")
.description("Generate a new module with model, route and controller")
.argument("<moduleName>", "Module Name")
.action(async (moduleName) => {
createModule(moduleName);
});
program.parse(process.argv)