
Security News
pnpm 11.5 Adds Support for Recognizing npm Staged Publishes
pnpm 11.5 now recognizes npm staged publish approvals in release metadata, preventing those releases from being mistaken for lower-trust package publishes.
methodulus
Advanced tools
npm i -S methodulus
This example creats a rest (express based) server using a controller class
Playerit is configured to run the class code locally via an http server.
import { Player } from './controllers/player';
import { Server, MethodulusConfig, MethodulusClassConfig, MethodType } from 'methodulus';
let config = new MethodulusConfig(['rest']);
config.use(Player, MethodType.Local, 'http://localhost:8090')
const server = new Server(process.env.PORT || 8020).configure(config).start();
import { Body, Method, MethodConfig, MethodType, Param, Query, Verbs, MethodError, MethodResult } from 'methodulus';
import { PlayerModel } from '../models/player';
@MethodConfig('Player')
export class Player {
@Method(Verbs.Post, '/api/player')
public async create() {
let p = new PlayerModel('1', 'player 1');
await DB.Player.insert(p);
return new MethodResult(p)
}
@Method(Verbs.Get, '/api/player/:player_id')
public async read( @Param('player_id') playerId: number) {
return await DB.Player.find({ 'Id': playerId });
}
@Method(Verbs.Put, '/api/player')
public async update() {
}
@Method(Verbs.Delete, '/api/player')
public delete() {
}
}
configuration must complete before the server starts. configure each controller class to its desired state
an instamce of methodulus can run multiple listeners in different channels. the current list is:
expresssocketioamqpredisin order to access the correct service methodulus uses a resolver, which may be a literal containing the service uri or a promise returning the same.
resolvers are attached to a class, allowing the application to use different resolvers for different services.
here is a simple local configuration:
let servers = ['express'];
let config = new MethodulusConfig(servers);
let resolver = 'http://localhost:8090';
config.use(TestClass, MethodType.Local,resolver);
The class
Playerto run locally.
avaliable options are
Local | Http | MQ | Socket
Local
run the code in the class, no proxy or transport required.
Http
run the code using an http request to a microservice.
MQ
use amqp rpc to execute the class code
Socket
directly connect to a server using websocket connection.
Redis
use redis rpc to execute the class code
creates an agnostic configured server.
const server = new Server(process.env.PORT);
Server methods are chainable and should e called in this order
const server = new Server(process.env.PORT).configure(config).start();
FAQs
Unknown package
The npm package methodulus receives a total of 15 weekly downloads. As such, methodulus popularity was classified as not popular.
We found that methodulus 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
pnpm 11.5 now recognizes npm staged publish approvals in release metadata, preventing those releases from being mistaken for lower-trust package publishes.

Security News
Federal audit finds NIST lacked a plan to clear the NVD backlog, wasted funds on duplicate work, and delayed use of CISA data.

Research
/Security News
A mini Shai-Hulud campaign compromised Red Hat Cloud Services npm packages to steal developer and CI/CD secrets during installation.