how does one import nodejs modules in a vanilla Javascript file? In other words, how can I use my nodejs modules in a vanilla javascript file for frontend scripting?
These modules are packaged using a tool called npm. You can use module loaders or bundlers like Browserify or Webpack to use npm modules in the frontend.
This might help you