How is plugin object named



  • In the docs their is an example

    var MyPlugin = { myMethod: function(postData, callback) { var req = cls.get('http').req; // current http request object. var res = cls.get('http').res; // current http response object. var uid = req.user.uid; // current user id // ... }, ...

    but it never says how to determine what MyPlugin should be for your plugin? can you use anything? or is it declared somewhere im missing?


  • GNU/Linux

    It should symbolize what your plugins entry-point needs to export for NodeBB.

    So you could just add module.exports = MyPlugin at the end of the file named within plugin.json.
    I admin the docs could've been better explained in this regards. Feel free to change ;-)



  • Ah that makes sense thanks


Log in to reply
 

Looks like your connection to NodeBB was lost, please wait while we try to reconnect.