H
H
hatealleverything2020-11-22 16:53:59
Express.js
hatealleverything, 2020-11-22 16:53:59

How can I output a variable to another file?

Good afternoon, I'm doing a project on node js, express, handlebars. Faced a problem with exporting a variable to another file that is connected to the html page.
This writes if connected via module exports and require - Uncaught ReferenceError: require is not defined at main.js
: then I doubt it very much, since everything is written correctly, like

export let a = 1
import {a} from '../database/itemsSelect'


The main question is how can I export a large block of data and work with them, and after outputting from js to html, I don’t need to send to html right away, I need to work with the js file, but in another
Just like a regular html css js stack is the same

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question