Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

mern-x

Package Overview
Dependencies
Maintainers
1
Versions
72
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mern-x - npm Package Compare versions

Comparing version 1.0.10 to 1.0.11

.gitattributes

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"
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc