i am creating an express project where i have some variables which needed to be passed in raw javascript(placed in folder static)
my express project name app.js my raw javascript file index.js
lets say i want to export variable x = 10;
i did
//app.js
var fs = require("fs");
//my express code
const x = 10;
module.exports = x;
now my normal javascript file
//index.js
import "../app.js"
window.alert(x)// how to alert x in window
my views html
<script src=./static/index.js ></script>
// please also explain any turaround if any //i read all the questions but didnt find one answering my question in simple terms
how to do it?