@pitaj Prior to running ./nodebb upgrade I always do apt-get-update apt-get-upgrade so the server is already fully updated.
If there is something else that NodeBB requires then it should be part of the nodebb upgrade command.
@julian Is this the newest way to write a plugin!
https://nodebb.readthedocs.io/en/latest/plugins/create.html
I get confused because i see code that uses
plugin.load = function (data, next) { ...
If writing plugins for the v1.x.x branch what documentation should I use to write updated code ?
EDIT:
I guess this is a better start: https://github.com/NodeBB/nodebb-plugin-quickstart
module.exports is a node.js thing right. Is it obsolete to use this? Should I only use plugin.load ?
Yes, you always need a module.exports
or exports
, otherwise, NodeBB will not see your hooks.
You can see at the end quick-start adds module.exports = plugin
FYI, you can shorten
var plugin = {}
plugin.load = function () { ... }
plugin.stuff = function () { ... }
module.exports = plugin
to just
exports.load = function () { ... }
exports.stuff = function () { ... }
I find this syntax more convenient depending on the plugin complexity.