
Security News
npm ‘is’ Package Hijacked in Expanding Supply Chain Attack
The ongoing npm phishing campaign escalates as attackers hijack the popular 'is' package, embedding malware in multiple versions.
Powerful lightweight mvc framework for nodejs inspired by Yii
Mvcjs is a first nodejs framework which supports modules as bundles!
npm install mvcjs
index.js
var di = require('mvcjs');
var framework = di.load('bootstrap');
framework.setBasePath(__dirname);
framework.init('app/', 'env.json');
app/env.json
{
"aliases": [
{
"key": "assetsPath",
"value": "@{basePath}/assets"
}
],
"components": [
{
"name": "core/logger",
"enabled": true,
"write": true,
"publish": true,
"console": true,
"port": 9001,
"file": "server.log"
},
{
"name": "core/router",
"errorRoute": "core/error"
},
{
"name": "core/favicon",
"path": "@{basePath}/favicon.ico"
},
{
"name": "core/view",
"themes": "@{appPath}/themes/",
"views": "@{appPath}/views/",
"theme": "default",
"cache": true
},
{
"name": "core/assets",
"path": "@{basePath}/storage/",
"hook": "^\\/assets"
},
{
"name": "db/mongo",
"connection": "mongodb://localhost/testdb"
}
],
"config": "config-test.js",
"assetsPath": "@{assetsPath}",
"port": 9000
}
app/config-test.js
module.exports = function (componet, di) {
"use strict";
var viewLoader, router,
logger = componet.get('core/logger'),
loggerModel = di.load('@{modelsPath}/logger');
viewLoader = componet.get('core/view');
viewLoader.setTheme('home');
// bind logger hook
logger.addHook(loggerModel.save.bind(loggerModel));
router = componet.get('core/router');
router.add([
{
pattern: 'home/<action>',
route: 'home/<action>'
},
{
pattern: 'posts/<action:(create|update|delete)>',
route: 'posts/<action>',
method: ['GET', 'POST']
},
{
pattern: 'user/<id:(\\d+)>',
route: 'user/view'
}
]);
router.add({
pattern: '/',
route: 'home/index'
});
};
FAQs
Powerful lightweight mvc framework for nodejs
The npm package mvcjs receives a total of 208 weekly downloads. As such, mvcjs popularity was classified as not popular.
We found that mvcjs demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The ongoing npm phishing campaign escalates as attackers hijack the popular 'is' package, embedding malware in multiple versions.
Security News
A critical flaw in the popular npm form-data package could allow HTTP parameter pollution, affecting millions of projects until patched versions are adopted.
Security News
Bun 1.2.19 introduces isolated installs for smoother monorepo workflows, along with performance boosts, new tooling, and key compatibility fixes.