
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
A thin framework for building modular web applications.
With npm:
npm install modapp
With yarn:
yarn add modapp
import { App } from 'modapp';
// A module keeping track of greetings
class Greetings {
constructor(app, params) {
this.app = app;
this.greetings = {};
}
addGreeting(lang, greeting) {
this.greetings[lang] = greeting;
}
removeGreeting(lang) {
delete this.greetlings[lang];
}
greet(lang) {
let greeting = this.greetings[lang];
console.log(greeting || "Unknown language");
}
dispose() {} // Nothing to dispose
}
// A module for swedish greetings
class EnglishGreeting {
constructor(app, params) {
this.app = app;
this.greeting = params.greeting || "Hello";
this.app.require(['greetings'], this._init.bind(this));
}
_init(module) {
this.module = module;
this.module.greetings.addGreeting('english', this.greeting);
}
dispose() {
this.module.greetings.removeGreeting('english');
}
}
// Creating the app with some module configuration. These parameters may be overwritten using url queries
let app = new App({ englishGreeting: { greeting: "Hi" }});
// Bundles are usually created dynamically using tools like webpacks require context.
let bundle = {
greetings: Greetings,
englishGreeting: EnglishGreeting
};
app.loadBundle(bundle)
.then(result => {
console.log("Modules loaded: ", result);
app.getModule('greetings').greet('english');
});
Modules can be loaded, deactivate, and reactivated while the application is running, allowing hotloading of new features and functionality to the application. New modules will simply hook into the application using the register/unregister methods provided (addGreeting and removeGreeting in the example).
Try resgate-test-app to see modapp in use.
For a class to be loaded by the app, it must follow the AppModule interface.
A module may expose any number of public methods, using camelCase as naming convention.
All properties should be considered private, as well as any methods starting with an underscore (_).
Any exposed method that allows other modules to register objects or callbacks, must come paired
with a method for unregistering.
The app module constructor.
It is only in the constructor that the module may call
app.require(...).
If app.require is called, the module must postpone registering any objects or callbacks until
the require callback is called to prevent memory leaks in case the App cannot fulfill the requirements
and discards the app module.
(#AppModule)
| Param | Type | Description |
|---|---|---|
| app | App | The app instance |
| params | Object.<string, *> | Module parameters from the app config |
Disposes the app module, removing any items or callbacks previously registered within the constructor or
in the app.require callback.
Once disposed, no more calls will be done to the module instance.
FAQs
A thin framework for building completely modular web applications.
We found that modapp 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.