quick_mate 1.0.0
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 +34 -0
- package/package.json +15 -0
package/index.js
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
const fs = require("fs/promises")
|
|
3
|
+
|
|
4
|
+
const { Command } = require("commander");
|
|
5
|
+
|
|
6
|
+
const program = new Command()
|
|
7
|
+
|
|
8
|
+
program
|
|
9
|
+
.name("ready_mate")
|
|
10
|
+
.description("A commandline tool for backend expressjs developers")
|
|
11
|
+
.version("1.0.0")
|
|
12
|
+
|
|
13
|
+
program
|
|
14
|
+
.command("make <thing>")
|
|
15
|
+
.description("Creates the base of the expressjs app including all folders and files")
|
|
16
|
+
.action((thing)=>{
|
|
17
|
+
if(thing == "base"){
|
|
18
|
+
fs.mkdir("models")
|
|
19
|
+
fs.mkdir("routes")
|
|
20
|
+
fs.mkdir("controllers")
|
|
21
|
+
fs.writeFile("index.js",
|
|
22
|
+
'const express = require("express")\n\nconst app = express()\n\napp.listen(4000,()=>{\n\nconsole.log("Server is running on port 4000")})'
|
|
23
|
+
)
|
|
24
|
+
}
|
|
25
|
+
})
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
program
|
|
29
|
+
.command("check")
|
|
30
|
+
.action(()=>{
|
|
31
|
+
console.log("Hello World!");
|
|
32
|
+
})
|
|
33
|
+
|
|
34
|
+
program.parse()
|
package/package.json
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "quick_mate",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "A commandline tools for expressjs developers",
|
|
5
|
+
"license": "ISC",
|
|
6
|
+
"author": "AbdulWahabKhan",
|
|
7
|
+
"type": "commonjs",
|
|
8
|
+
"main": "index.js",
|
|
9
|
+
"bin": {
|
|
10
|
+
"ready_mate": "index.js"
|
|
11
|
+
},
|
|
12
|
+
"dependencies": {
|
|
13
|
+
"commander": "^14.0.2"
|
|
14
|
+
}
|
|
15
|
+
}
|