Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Expressway is an extensible, MEAN microframework for Node.js, designed to be completely modular. It is heavily influenced by Taylor Otwell's Laravel for PHP and Google's front-end framework, AngularJS.
npm install breachofmind/expressway --save
# Or, for cool kids:
yarn add breachofmind/expressway
src
, some like lib
.
Expressway is designed to be agnostic to your application's structure.Quite possibly the most useful feature is Expressway's IOC implementation, which is borrowed almost exactly from AngularJS.
app.call(function)
.app.service('profit', "No more require()!");
function myFunction(profit) {
return profit;
}
app.call(myFunction); // "No more require()"!
This is a very simple example. Imagine how useful this is when it's available in your controller routes:
class MyController extends expressway.Controller
{
/**
* MyController.index route.
* GET /
*/
index(request,response,next,profit) {
return profit;
}
}
Services can be anything - strings, functions, objects, etc.
If you just want to get started with a sensible structure, the Expressway Yeoman generator is the way to go.
npm install breachofmind/expressway-generator -g
mkdir myApp && cd myApp
yo expressway myApp
npm install breachofmind/expressway.
// expressway.js
var expressway = require('expressway');
var app = expressway({
rootPath: __dirname,
});
// Add some services.
function motivationalQuote() {
return `A nation that separates it's warriors from
its scholars will have its fighting done by fools
and its thinking done by cowards.`;
}
app.service(motivationalQuote);
// Expressway apps have a "root" app.
// Any extensions you might add later are mounted to this root app.
app.root.routes = [
{
// Routes are added in a declarative manner.
"GET /" : function(request,response,next) {
return response.send("Hello World");
},
// Anonymous routes allow for dependency injection.
"GET /quote" : function(request,response,next,motivationalQuote) {
return response.send( motivationalQuote() );
},
// As your app gets bigger, you might want to add a controller.
"GET /:model" : "ModelController.fetchAll",
// You may want to stack middleware on a route.
"POST /:model/:id" : [
// The name of a middleware to pass through.
"ModelRequest",
// An anonymous middleware.
function(request,response,next) {
console.log('middleware test');
next();
},
// Add finally, the controller method I wanted.
"ModelController.save"
]
},
// A simple "NotFound" middleware in case nothing is matched.
'NotFound'
];
// Start the server.
app.start();
node expressway.js
The Wiki is where it's at.
I'll be adding more documentation very soon as the API smooths out.
mocha test
FAQs
A modular MVC microframework for Node.js Express and your impatience
We found that expressway demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.