
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 Node application creator about plugin architecture approach.
Create your module with npm
mkdir -p plugins/myMainPackager
cd plugins/myMainPackager
npm init
touch index.js
Create a plugin plugins/myMainPackager/index.js
module.exports = function setup(imports, done) {
imports.myValueExported = 123;
done(); // call done when finish it
}
Your main.js script:
var ark = require('node-ark');
ark.create(["plugins/myMainPackager"], function (imports) {
console.log("My application is running! All plugins are loaded");
})
Here is your package.json:
{
"name": "myMainPackager",
"version": "0.0.1",
"description": "My Demo Application",
"main": "index.js",
}
Edit the package.json from plugin that require the dependency.
{
"name": "myMainPackager",
"version": "0.0.1",
"description": "My Demo Application",
"main": "index.js",
"plugin": {
"requires": [
"plugins/myAnotherPlugin"
]
}
}
Create a new package.json:
{
"name": "myAnotherPlugin",
"version": "0.0.1",
"description": "My Plugin",
"main": "myPluginSetup.js"
}
Create the target plugin plugins/myAnotherPlugin/myPluginSetup.js:
module.exports = function setup(imports, done) {
imports.shareThisObject = {
name: "Amazing plugin system",
run: function () {
return this.name + " is running"
}
};
done(); // call done when finish it
}
Then, from myMainPackager.js plugin you can do access the shared object:
module.exports = function setup(imports, done) {
var sharedObject = imports.shareThisObject;
console.log("Who is?", sharedObject.name);
console.log("Do what?", sharedObject.run());
done(); // call done when finish it
}
FAQs
A Node application creator about plugin architecture approach.
We found that node-ark 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.