-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
74 lines (69 loc) · 1.79 KB
/
index.js
File metadata and controls
74 lines (69 loc) · 1.79 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
// Inquirer node package manager import and to link the generate markdown file.
const fs = require('fs');
const inquirer = require('inquirer')
const generatedMarkdown = require("./generateMarkdown")
const questions = [
{
type: "input",
message: "What is your projects title?",
name: "title",
},
{
type: "input",
message: "What is your projects description?",
name: "description",
},
{
type: "input",
message: " What did you Install for this Project?",
name: "installation",
},
{
type: "input",
message: " How can we use this project?",
name: "usage",
},
{
type: "input",
message: " How to contribute to this project?",
name: "contribution",
},
{
type: "input",
message: " How to test this application?",
name: "test",
},
{
type: "input",
message: " Enter GitHub Username?",
name: "github",
},
{
type: "input",
message: " Enter GitHub profile url?",
name: "profile",
},
{
type: "input",
message: " Enter email address?",
name: "email",
},
{
type: "list",
message: "Which license is needed for this project?",
name: "license",
choices: ["None", "MIT", "GPL", "Boost Software", "Apache Software"],
},
];
const writeToFile = (fileName, data) => {
fs.writeFile(fileName, data, function(err) {
console.log(data),
err ? console.error(err) : console.log("README.md Generated!")
})
}
const init = () => {
inquirer.prompt(questions).then((data) => {
writeToFile("./output/README.md", generatedMarkdown(data))
})
}
init()