
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.
rest-bundle
Advanced tools
RestBundle is a Javascript base class for a REST resource bundles that can be plugged into a nodejs express application
Simplify REST API creation and maintentance with re-usable REST bundles. Encapsulate related REST services in a single JavaScript class that extends RestBundle.
Example: Define a REST bundle comprising a single resource (i.e., /greeting/hello)
with handlers for GET and POST:
class HelloRest extends RestBundle {
constructor(name="greeting",options = {}) {
super(name, options);
var handlers = [
this.resourceMethod("get", "hello", this.getHello, "text/html"),
this.resourceMethod("post", "hello", this.onDie),
];
Object.defineProperty(this, "handlers", {
value: handlers,
});
}
getHello(req, res) { return "hello"; }
postHello(req, res) { throw new Error("goodbye"); }
}
Add HelloRest to a nodejs application:
const HelloRest = require("../test/hello-rest");
var helloRest = new HelloRest("greeting");
helloRest.bindExpress(app);
Launch web server:
npm start
A RestBundle can be shared for use by others as an npm package.
RestBundle relies on Vue.js for modular web components.
npm run devRestBundle uses Vuex as its application store. The RestBundle state hierarchy comprises one or more services having one or more API's, each of which has its own apiModel:
state.restBundle.service.apiName.apiModel
Vue components that serve as the primary view of a RestBundle api must define a 'service' property
and include the rb-api-mixin.
mixins: [
require("./mixins/rb-about-mixin.js"),
require("./mixins/rb-api-mixin.js").createMixin("web-socket"),
],
props: {
service: "RbServer",
},
beforeMount(): {
this.apiLoad().then(apiModel=>...).catch(e=>...);
},
Other RestBundle Vue components can become informed of the loading of another
apiModel using the promise returned by onApiModelLoaded(apiName,service):
mixins: [
require("./mixins/rb-about-mixin.js"),
require("./mixins/rb-api-mixin.js").createMixin("some-other-api"),
],
props: {
service: "RbServer",
},
beforeMount(): {
this.onApiModelLoaded("web-socket", "RbServer").then(apiModel=>...).catch(e=>...);
},
FAQs
RestBundle is a Javascript base class for a REST resource bundles that can be plugged into a nodejs express application
The npm package rest-bundle receives a total of 37 weekly downloads. As such, rest-bundle popularity was classified as not popular.
We found that rest-bundle 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.