Answer the question
In order to leave comments, you need to log in
How to create a plugin for Node.JS?
The idea is pretty simple. Make an interface for plugins, which would be NPM packages.
For example, I can declare something like this inside package.json:
{
plugins: ['fire', 'strike', 'ymz']
}
function callback(eventData) {
// тут плагин что-то делает с данными в eventData
return eventData;
}
module.exports = function () {
return {eventName: 'preRender', callback: callback};
}
npm list
, npm install
and a program call require()
. system()
calls, but somehow it looks inorganic, plus I need to somehow update the plugins. Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question