-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcli.js
More file actions
executable file
·38 lines (32 loc) · 950 Bytes
/
Copy pathcli.js
File metadata and controls
executable file
·38 lines (32 loc) · 950 Bytes
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
#!/usr/bin/env node
const chalk = require("chalk");
const clear = require("clear");
const figlet = require("figlet");
const inquirer = require("inquirer");
const createProject = require("./main");
clear();
console.log(
chalk.yellow(figlet.textSync("NodeBoiler", { horizontalLayout: "full" }))
);
async function promptForMissingOptions() {
const defaultTemplate = "NodeJs with Mongoose";
const questions = [];
questions.push({
type: "list",
name: "template",
message: "Please choose which project template to use",
choices: ["NodeJs with Mongoose"],
// choices: ["NodeJs with Mongoose", "NodeJs with default Mongo Client"],
default: defaultTemplate
});
const answers = await inquirer.prompt(questions);
return {
template: answers.template,
projectName: process.argv[2] || 'myapp'
};
}
async function init() {
options = await promptForMissingOptions();
await createProject(options);
}
init();