create-myexam-app 1.0.2 → 1.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js CHANGED
@@ -13,7 +13,7 @@ console.log('\n[1] Hospital Management System')
13
13
  console.log('[2] Library System Management')
14
14
  console.log('[3] Parking Management System')
15
15
  console.log('[4] School Management System\n')
16
- console.log('[5] payment controller' )
16
+ console.log('[5] payment ' )
17
17
 
18
18
  rl.question('Pick (1-4): ', (answer) => {
19
19
 
@@ -22,7 +22,7 @@ rl.question('Pick (1-4): ', (answer) => {
22
22
  '2': 'libray system management',
23
23
  '3': 'parking managementt system',
24
24
  '4': 'school management system',
25
- '5': 'paymentController',
25
+ '5': 'payment',
26
26
  }
27
27
 
28
28
  const chosen = projects[answer]
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  "name": "create-myexam-app",
4
4
 
5
- "version": "1.0.2",
5
+ "version": "1.0.4",
6
6
 
7
7
  "description": "My exam projects",
8
8
 
@@ -0,0 +1,71 @@
1
+ #!/usr/bin/env node
2
+
3
+ const fs = require('fs')
4
+ const path = require('path')
5
+ const readline = require('readline')
6
+
7
+ const rl = readline.createInterface({
8
+ input: process.stdin,
9
+ output: process.stdout
10
+ })
11
+
12
+ console.log('\n[1] Hospital Management System')
13
+ console.log('[2] Library System Management')
14
+ console.log('[3] Parking Management System')
15
+ console.log('[4] School Management System\n')
16
+ console.log('[5] payment ' )
17
+
18
+ rl.question('Pick (1-4): ', (answer) => {
19
+
20
+ const projects = {
21
+ '1': 'hospital management system',
22
+ '2': 'libray system management',
23
+ '3': 'parking managementt system',
24
+ '4': 'school management system',
25
+ '5': 'payment',
26
+ }
27
+
28
+ const chosen = projects[answer]
29
+
30
+ if (!chosen) {
31
+ console.log('Invalid choice!')
32
+ rl.close()
33
+ return
34
+ }
35
+
36
+ const src = path.join(__dirname, 'projects', chosen)
37
+ const dest = path.join(process.cwd(), chosen)
38
+
39
+ console.log(`\nDownloading ${chosen}...`)
40
+ copyFolder(src, dest)
41
+
42
+ console.log(`\nDone! Now run:`)
43
+ console.log(`\n--- FRONTEND ---`)
44
+ console.log(` cd "${chosen}/frontend"`)
45
+ console.log(` npm install`)
46
+ console.log(` npm run dev`)
47
+ console.log(`\n--- BACKEND ---`)
48
+ console.log(` cd "${chosen}/backend"`)
49
+ console.log(` npm install`)
50
+ console.log(` npm start\n`)
51
+
52
+ rl.close()
53
+ })
54
+
55
+ function copyFolder(src, dest) {
56
+ fs.mkdirSync(dest, { recursive: true })
57
+ const entries = fs.readdirSync(src, { withFileTypes: true })
58
+
59
+ for (let entry of entries) {
60
+ const srcPath = path.join(src, entry.name)
61
+ const destPath = path.join(dest, entry.name)
62
+
63
+ if (entry.name === 'node_modules') continue
64
+
65
+ if (entry.isDirectory()) {
66
+ copyFolder(srcPath, destPath)
67
+ } else {
68
+ fs.copyFileSync(srcPath, destPath)
69
+ }
70
+ }
71
+ }
@@ -0,0 +1,12 @@
1
+ {
2
+
3
+ "name": "create-myexam-app",
4
+
5
+ "version": "1.0.0",
6
+
7
+ "lockfileVersion": 3,
8
+
9
+ "requires": true,
10
+
11
+ "packages": {}
12
+ }
@@ -0,0 +1,45 @@
1
+ {
2
+
3
+ "name": "create-myexam-app",
4
+
5
+ "version": "1.0.3",
6
+
7
+ "lockfileVersion": 3,
8
+
9
+ "requires": true,
10
+
11
+ "packages": {
12
+
13
+
14
+ "": {
15
+
16
+
17
+
18
+ "name": "create-myexam-app",
19
+
20
+
21
+
22
+ "version": "1.0.3",
23
+
24
+
25
+
26
+ "license": "ISC",
27
+
28
+
29
+
30
+ "bin": {
31
+
32
+
33
+
34
+
35
+ "create-myexam-app": "index.js"
36
+
37
+
38
+
39
+ }
40
+
41
+
42
+ }
43
+
44
+ }
45
+ }
@@ -0,0 +1,29 @@
1
+ {
2
+
3
+ "name": "create-myexam-app",
4
+
5
+ "version": "1.0.3",
6
+
7
+ "description": "My exam projects",
8
+
9
+ "main": "index.js",
10
+
11
+ "bin": {
12
+
13
+
14
+ "create-myexam-app": "./index.js"
15
+
16
+ },
17
+
18
+ "files": [
19
+
20
+
21
+ "index.js",
22
+
23
+
24
+ "projects/"
25
+
26
+ ],
27
+
28
+ "license": "ISC"
29
+ }