Socket
Socket
Sign inDemoInstall

nevm-mvc-scaffold

Package Overview
Dependencies
217
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.10 to 1.0.11

32

index.js

@@ -18,6 +18,6 @@ const fs = require('fs');

console.log("Hey! I am the NEVM MVC Scaffolding Tool you've been searching for!");
console.log("\x1b[1m Hey! I am the NEVM MVC Scaffolding Tool you've been searching for!\x1b[0m");
console.log();
console.log();
console.log("Let's get started on your nodejs app development journey with everything you need to work in peace with a clean MVC structure and a little extra magic... ");
console.log("\x1b[1m Let's get started on your nodejs app development journey with everything you need to work in peace with a clean MVC structure and a little extra magic... \x1b[0m");
console.log()

@@ -29,3 +29,3 @@ function showDivider(character, length) {

// Example usage:
// Print Divider:
showDivider('-', 40);

@@ -43,2 +43,4 @@ // Create directories

showDivider('-', 40);
// Create a readline interface for user input

@@ -71,2 +73,3 @@ const rl = readline.createInterface({

function generateServerFile() {
showDivider('-', 40);
const serverFile = path.join(process.cwd(), 'server.js');

@@ -97,2 +100,3 @@ const serverContent = `

function installORM() {
showDivider('-', 40);
rl.question('Do you want to install an ORM? (sequelize(s)/mongoose(m)/neither(n)): ', (answer) => {

@@ -114,2 +118,3 @@ if (answer.toLowerCase() === 'sequelize' || answer.toLowerCase() === 's') {

function installSequelize() {
showDivider('-', 40);
console.log('Installing Sequelize...');

@@ -132,2 +137,3 @@ exec('npm install sequelize', (error, stdout, stderr) => {

function installMongoose() {
showDivider('-', 40);
console.log('Installing Mongoose...');

@@ -149,2 +155,3 @@ exec('npm install mongoose', (error, stdout, stderr) => {

function vueInstall() {
showDivider('-', 40);
// Save the current working directory

@@ -155,7 +162,7 @@ const currentDirectory = process.cwd();

if (answer.toLowerCase() === 'y') {
const frontEndDirectory = './frontend';
const frontEndDirectory = 'frontend';
console.log('Installing Vue.js with Vite...');
process.chdir(frontEndDirectory); // Change directory to frontend
exec('npm install vite @vitejs/plugin-vue', (error, stdout, stderr) => {
process.chdir(currentDirectory);
const installCommand = 'npm install vite @vitejs/plugin-vue';
exec(installCommand, { cwd: frontEndDirectory }, (error, stdout, stderr) => {
process.chdir(currentDirectory); // Restore the original directory
if (error) {

@@ -167,3 +174,3 @@ console.error(`Error installing Vue.js with Vite: ${error}`);

console.log('Vue.js with Vite installed successfully.');
updateFrontend();
updateFrontend(); // Move updateFrontend call here
});

@@ -178,5 +185,10 @@ } else {

// Update frontend files and folders
function updateFrontend() {
const frontendPackageJsonPath = path.join(process.cwd(), 'frontend', 'package.json');
showDivider('-', 40);
console.error(`Current Directory: ${process.cwd()}`);
const frontendPackageJsonPath = path.join(process.cwd(), 'package.json');
// const frontendPackageJson = require(frontendPackageJsonPath);
console.error(`Package json exists at: ${frontendPackageJsonPath}`);
const frontendPackageJson = require(frontendPackageJsonPath);

@@ -187,3 +199,3 @@ // Update scripts in package.json

fs.writeFileSync(frontendPackageJsonPath, JSON.stringify(frontendPackageJson, null, 2));
showDivider('-', 40);
// Create 'router' directory if it doesn't exist

@@ -190,0 +202,0 @@ const routerDirectory = path.join(process.cwd(), 'frontend', 'src', 'router');

{
"name": "nevm-mvc-scaffold",
"version": "1.0.10",
"version": "1.0.11",
"description": "Initialize project structure for Node.js applications following the MVC pattern with express.js, vue, vue-router and vite",

@@ -8,3 +8,5 @@ "main": "index.js",

"start": "node index.js",
"postinstall": "cp index.js ../../setup.js && cd ../.. && node setup.js"
"postinstall": "cp index.js ../../setup.js && cd ../.. && node setup.js",
"dev": "vite",
"build": "vite build"
},

@@ -24,3 +26,10 @@ "keywords": [

"author": "Jesil Jose (the-provost)",
"license": "MIT"
}
"license": "MIT",
"dependencies": {
"@vitejs/plugin-vue": "^5.0.4",
"express": "^4.18.3",
"sequelize": "^6.37.1",
"vite": "^5.1.4",
"vue-router": "^4.3.0"
}
}
SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc