How to Import Octoprint Javascript Client Library to node red

Hi guys, does anyone know how to import Javascript Client Library to node red in order to use the OctoPrintClient function globally in node red. I am not sure if I am doing it in the correct way but here is my method:

  1. wget http://octopi.local/static/webassets/packed_client.js in node-red directory
  2. edit setting.js by adding OctoPrintClient : require('./packed_client') in functionglobalcontext
    It doesn't work and I get the error of " Cannot read property 'isFunction' of undefined"
    I am just a beginner to programming or computer science so bear with me if I did any silly mistake.