
Security News
crates.io Ships Security Tab and Tightens Publishing Controls
crates.io adds a Security tab backed by RustSec advisories and narrows trusted publishing paths to reduce common CI publishing risks.
accelerated.api.module
Advanced tools
This package is an easy-to-use npm module that'll easily allow you to create modules for accelerated.api, extending our module class so that when we roll updates out, you're code base is preserved and can gracefully update.
First, npm install accelerated.api.module --save in your node.js project.
The goal here is to modularize your project into various aspects. For instance, you might be writing a users model with full CRUD API capatabilities. In this example, you would want to create a folder module in your project directory and create an index.js, so your project structure now looks like:
/project
|__ /index.js
|__ /module
|__ /index.js
Now go ahead and start with the following code in /module/index.js. Note the visible accelerated methods that are being called to extend the module's middleware, model, and routes:
module.exports = (function() {
// you can require this or other modules using accelerated.api.module
var module = new require('accelerated.api.module')();
// set your module's key for reference by middlwares, models, and routes
module.setKey('users');
// set your module's name for logging output
module.setName('Users Module');
// you can choose to extend your module's model
module.extendModel(function(model, express, app, models) {
// modify model to include user create, retrieve, update, and delete methods
return model;
});
// you can choose to extend your module's middleware
module.appendMiddleware(function(express, app, models) {
// modify app to include user authentication middleware
return app;
});
// you can choose to extend your module's routes
module.appendRoute(function(express, app, models) {
// modify app to include user CRUD routes
return app;
});
return module;
})();
Go ahead and use the following code in /index.js, requiring and using your newly created module within your accelerated project:
var api = require('accelerated.api');
var module = require('./module');
api.useMiddlewares([
[module.key, module.middleware]
]);
api.useModels([
[module.key, module.model]
]);
api.useRoutes([
[module.key, module.route]
]);
api.run();
Viola! You now have a highly-organized, highly-efficient, fully-logging node.js express app, with decoupled data logic that's abstracted just right.
FAQs
Extensible module for accelerated.api.
The npm package accelerated.api.module receives a total of 8 weekly downloads. As such, accelerated.api.module popularity was classified as not popular.
We found that accelerated.api.module 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.

Security News
crates.io adds a Security tab backed by RustSec advisories and narrows trusted publishing paths to reduce common CI publishing risks.

Research
/Security News
A Chrome extension claiming to hide Amazon ads was found secretly hijacking affiliate links, replacing creators’ tags with its own without user consent.

Security News
A surge of AI-generated vulnerability reports has pushed open source maintainers to rethink bug bounties and tighten security disclosure processes.