Comparing version 1.0.10 to 1.0.11
38
index.js
@@ -1,21 +0,25 @@ | ||
// lib/index.js | ||
class MyMiniFramework { | ||
constructor() { | ||
this.routes = []; | ||
} | ||
#!/usr/bin/env node | ||
addRoute(path, handler) { | ||
this.routes.push({ path, handler }); | ||
} | ||
const { program } = require('commander'); | ||
const fs = require('fs'); | ||
const path = require('path'); | ||
handleRequest(request) { | ||
for (const route of this.routes) { | ||
if (request.url === route.path) { | ||
return route.handler(); | ||
} | ||
} | ||
return '404 Not Found'; | ||
} | ||
program | ||
.version('1.0.0') | ||
.description('A CLI tool to generate a simple index.js project') | ||
.requiredOption('-n, --name <name>', 'Set project name') | ||
.requiredOption('-d, --directory <directory>', 'Set project directory') | ||
.parse(process.argv); | ||
const projectName = program.name; | ||
const projectDirectory = program.directory; | ||
const projectPath = path.join(process.cwd(), projectDirectory); | ||
function generateProject() { | ||
fs.mkdirSync(projectPath, { recursive: true }); | ||
const indexJSContent = `console.log("Hello, ${projectName}!");\n`; | ||
fs.writeFileSync(path.join(projectPath, 'index.js'), indexJSContent); | ||
console.log(`Simple index.js project "${projectName}" generated at ${projectPath}`); | ||
} | ||
module.exports = MyMiniFramework; | ||
generateProject(); |
{ | ||
"name": "mern-x", | ||
"version": "1.0.10", | ||
"description": "", | ||
"version": "1.0.11", | ||
"description": "MERN-X is a comprehensive full-stack framework designed to streamline the development of web applications using the popular MERN stack: MongoDB, Express.js, React, and Node.js. Built with simplicity and scalability in mind, MERN.js empowers developers to create robust and efficient applications from end to end.", | ||
"main": "index.js", | ||
@@ -13,8 +13,8 @@ "scripts": { | ||
"dependencies": { | ||
"express": "^4.18.2" | ||
"commander": "^12.0.0" | ||
}, | ||
"files": ["src"], | ||
"bin": { | ||
"mern-x": "./src/" | ||
"simple-js-project-cli": "./index.js" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
8069
9
20
2
+ Addedcommander@^12.0.0
+ Addedcommander@12.1.0(transitive)
- Removedexpress@^4.18.2
- Removedaccepts@1.3.8(transitive)
- Removedarray-flatten@1.1.1(transitive)
- Removedbody-parser@1.20.3(transitive)
- Removedbytes@3.1.2(transitive)
- Removedcall-bind@1.0.7(transitive)
- Removedcontent-disposition@0.5.4(transitive)
- Removedcontent-type@1.0.5(transitive)
- Removedcookie@0.7.1(transitive)
- Removedcookie-signature@1.0.6(transitive)
- Removeddebug@2.6.9(transitive)
- Removeddefine-data-property@1.1.4(transitive)
- Removeddepd@2.0.0(transitive)
- Removeddestroy@1.2.0(transitive)
- Removedee-first@1.1.1(transitive)
- Removedencodeurl@1.0.22.0.0(transitive)
- Removedes-define-property@1.0.0(transitive)
- Removedes-errors@1.3.0(transitive)
- Removedescape-html@1.0.3(transitive)
- Removedetag@1.8.1(transitive)
- Removedexpress@4.21.1(transitive)
- Removedfinalhandler@1.3.1(transitive)
- Removedforwarded@0.2.0(transitive)
- Removedfresh@0.5.2(transitive)
- Removedfunction-bind@1.1.2(transitive)
- Removedget-intrinsic@1.2.4(transitive)
- Removedgopd@1.0.1(transitive)
- Removedhas-property-descriptors@1.0.2(transitive)
- Removedhas-proto@1.0.3(transitive)
- Removedhas-symbols@1.0.3(transitive)
- Removedhasown@2.0.2(transitive)
- Removedhttp-errors@2.0.0(transitive)
- Removediconv-lite@0.4.24(transitive)
- Removedinherits@2.0.4(transitive)
- Removedipaddr.js@1.9.1(transitive)
- Removedmedia-typer@0.3.0(transitive)
- Removedmerge-descriptors@1.0.3(transitive)
- Removedmethods@1.1.2(transitive)
- Removedmime@1.6.0(transitive)
- Removedmime-db@1.52.0(transitive)
- Removedmime-types@2.1.35(transitive)
- Removedms@2.0.02.1.3(transitive)
- Removednegotiator@0.6.3(transitive)
- Removedobject-inspect@1.13.3(transitive)
- Removedon-finished@2.4.1(transitive)
- Removedparseurl@1.3.3(transitive)
- Removedpath-to-regexp@0.1.10(transitive)
- Removedproxy-addr@2.0.7(transitive)
- Removedqs@6.13.0(transitive)
- Removedrange-parser@1.2.1(transitive)
- Removedraw-body@2.5.2(transitive)
- Removedsafe-buffer@5.2.1(transitive)
- Removedsafer-buffer@2.1.2(transitive)
- Removedsend@0.19.0(transitive)
- Removedserve-static@1.16.2(transitive)
- Removedset-function-length@1.2.2(transitive)
- Removedsetprototypeof@1.2.0(transitive)
- Removedside-channel@1.0.6(transitive)
- Removedstatuses@2.0.1(transitive)
- Removedtoidentifier@1.0.1(transitive)
- Removedtype-is@1.6.18(transitive)
- Removedunpipe@1.0.0(transitive)
- Removedutils-merge@1.0.1(transitive)
- Removedvary@1.1.2(transitive)