-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
76 lines (75 loc) · 1.71 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
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
// TODO: Include packages needed for this application
const inquirer = require('inquirer');
const fs = require('fs');
const generateMarkdown = require('./utils/generateMarkdown');
// TODO: Create a function to write README file
inquirer
.prompt([
{
type: 'input',
name: 'title',
message: "What is your project's title?",
},
{
type: 'input',
name: 'description',
message: 'Write a short description for your project.',
},
{
type: 'checkbox',
name: 'table',
message: 'What to include in table of contents?',
choices : [
'installation',
'usage',
'contribute',
'tests',
'questions'
]
},
{
type: 'input',
name: 'installation',
message: 'Installation instructions:',
},
{
type: 'input',
name: 'usage',
message: 'Usage information:',
},
{
type: 'list',
name: 'license',
message: 'What sort of license would you like?',
choices : [
"MIT",
"GNU GPL v3.0",
"Apache 2.0"
]
},
{
type: 'input',
name: 'contribute',
message: 'Contribution guidelines:',
},
{
type: 'input',
name: 'tests',
message: 'Test instructions:',
},
{
type: 'input',
name: 'github',
message: 'GitHub username:',
},
{
type: 'input',
name: 'email',
message: 'Email:',
},
])
.then((answers) => {
const newReadme = generateMarkdown(answers);
fs.writeFile('generated-README.md', newReadme, (err) =>
err ? console.log(err) : console.log('Congrats! You created a README for your project!'));
});