-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
97 lines (93 loc) · 2.43 KB
/
index.js
File metadata and controls
97 lines (93 loc) · 2.43 KB
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
// TODO: Include packages needed for this application
import inquirer from 'inquirer';
import fs from 'fs';
import generateMarkdown from './utils/generateMarkdown.js';
// TODO: Create an array of questions for user input
const questions = [
{
type: "input",
name: "title",
message: "What is the title of your project?",
},
{
type: "input",
name: "description",
message: "Provide a description of your project:",
},
{
type: "input",
name: "installation",
message: "What are the installation instructions?",
},
{
type: "input",
name: "usage",
message: "What is the usage information?",
},
{
type: "input",
name: "technologies",
message: "What technologies were used to create this project?",
},
{
type: "input",
name: "screenshots",
message: "Provide the file path to the screenshots:",
},
{
type: "input",
name: "video",
message: "Provide a link to the walkthrough video:",
},
{
type: "input",
name: "link",
message: "Enter the URL link to your deployed application:",
},
{
type: "input",
name: "contributing",
message: "What are the contribution guidelines?",
},
{
type: "input",
name: "contributors",
message: "Add the names of everyone who particpated in this project:",
},
{
type: "input",
name: "tests",
message: "What are the test instructions?",
},
{
type: "list",
name: "license",
message: "Choose a license for your project:",
choices: ["MIT", "Apache 2.0", "GPL 3.0", "None"],
},
{
type: "input",
name: "github",
message: "Enter your GitHub username:",
},
{
type: "input",
name: "email",
message: "Enter your email address:",
},
];
// TODO: Create a function to write README file
function writeToFile(fileName, data) {
fs.writeFile(fileName, data, (err) =>
err ? console.error(err) : console.log('README.md was created successfully!')
);
};
// TODO: Create a function to initialize app
function init() {
inquirer.prompt(questions).then((answers) => {
const markdown = generateMarkdown(answers);
writeToFile("README.md", markdown)
});
}
// Function call to initialize app
init();