Loading lodash or other external JS libraries

    Javascriptbeginnerbugs/issues

    Monib Ahmed
    May 20 2023 | 3:55 pm
    Hi, I'm trying to load some external JS libraries. Can you advise me what is the recommended way of doing this?
    I've tried including the paths in Files Search Path, and the paths are showing up MacOS:/Users/monibahmed/node_modules/lodash MacOS:/Users/monibahmed/node_modules/lodash/fp
    But the following post "undefined" in the console:
    var lodash = require("lodash"); post(lodash.VERSION+'\n')

    • nick rothwell | project cassiel's icon
      nick rothwell | project cassiel
      May 21 2023 | 5:37 pm
      Load it by message:[script npm install lodash] and use in JS by const _ = require('lodash') Seems to work fine here.
      Share
    • Monib Ahmed's icon
      Monib Ahmed's icon
      Monib Ahmed
      May 21 2023 | 7:00 pm
      Hi, yes the node.script object works fine with Lodash, but not the js object?
      thanks
    • nick rothwell | project cassiel's icon
      nick rothwell | project cassiel's icon
      nick rothwell | project cassiel
      May 22 2023 | 5:00 pm
      Ah, no. [js] and [jsui] are strictly limited in scope.
    • Monib Ahmed's icon
      Monib Ahmed's icon
      Monib Ahmed
      May 22 2023 | 6:57 pm
      Thank you! I guess I’ll start using node.