I need to have a colormap on my javascript page. I am using Flask for server side (written in python). I have a javascript file that requires colormap module (installed using "npm install colormap"), for rendering colormaps on the client side. I tried to import it from my javascript file index.js
var colormap = import("colormap");
which I got the error:
index.js:2 Uncaught (in promise) TypeError: Failed to resolve module specifier 'colormap'
at index.js:2
and I also tried:
let colormap = require('colormap')
and I got the error require is not defined.
how can I solve it? I am trying to import the js file with colormap directly into my html (so the javascript file will have reference), but I cant find what file should I import.