
Security News
Frontier AI Is Now Critical Infrastructure
The Fable shutdown shows how quickly model access can become a business continuity risk for AI-dependent engineering teams.
[](https://www.npmjs.com/package/js-plugin) [](https://travis-ci.org/rekit/js-plugin)
js-plugin is a general and simple plugin engine for creating extensible and maintainable JavaScript applications for both browser and nodejs.
Web applications are becoming more and more complicated nowadays. To separate concerns, decouple business logic, a large application should be well designed. One of best practices is plugin based architecture. Whenever you add a new feature, it should not add much complication to the system so that the project could be always maintainable when it grows.
Note that every plugin in the system maybe not bundled separatly but just a logical plugin. Below I give two cases about the advantages of plugin based architecture.
Menu is used to navigate among functions of an application. Whenever you add a new feature, it may need a menu item in the menu. Say that we have a menu component like below (from Github settings page):
import React from 'react';
export default function Menu() {
return (
<ul>
<li>Profile<li>
<li>Account<li>
<li>Security<li>
</ul>
);
}
Now we need to add a new feature to block users. It needs a menu item named 'Blocked users'. Normallly we need to change Menu component:
return (
<ul>
<li>Profile<li>
<li>Account<li>
<li>Security<li>
<li>Blocked Users<li>
</ul>
);
It looks quite intuitive but it's not extensible. Whenever we add features to the application, we need to change Menu component and finally it will become too complicated to maintain. Especially the menu item is dynamically like it needs to be show or no show according to permission. We have to embed the permission logic in Menu component. For example: if the block user feature is only available for premium users:
return (
<ul>
<li>Profile<li>
<li>Account<li>
<li>Security<li>
{user.isPremium() && <li>Blocked Users<li>}
</ul>
);
Essentially the menu item is a part of feature of 'block user'. All the logic of the feature should be only in the scope of the feature itself while the Menu is just a pure presentation component which is only responsible for navigation without knowing about other business logic.
So we need to make Menu extensible, that is it allows to register menu items. Below is how we do it using js-plugin.
FAQs
[](https://www.npmjs.com/package/js-plugin) [](https://travis-ci.org/rekit/js-plugin)
The npm package js-plugin receives a total of 1,466 weekly downloads. As such, js-plugin popularity was classified as popular.
We found that js-plugin 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
The Fable shutdown shows how quickly model access can become a business continuity risk for AI-dependent engineering teams.

Security News
AI agents are pulling packages into environments no scanner is watching, creating exposure before security teams can see it.

Security News
GitHub Actions checkout now blocks risky pull_request_target checkouts by default to help prevent pwn request supply chain attacks.