Click here to Skip to main content
15,885,985 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am having trouble showing data obtained from my Node.js program on the browser. I am new to front end as only ever worked server side. I have a program that uses an NPM module called coinbase-pro. I have data obtained from this API and want to display it on the chrome browser. Because this module uses countless 'require' statements it will encounter an error due to the new ES6 standards, which is the same for any common JS components.
Can someone please post a simple bare bones example of a complete file set ie. (index.html, app.js or app.mjs) that uses a common JS component (or anything where you would normally use 'require') to 'make' data and then displays that data in the browser/browser console when the server is opened?

Can this be done with 'vanilla' JS, without babel or a bundler ?

What I have tried:

I have tried almost everything but keep getting denied when using anything that uses 'require'. I cant find a way around it.
Posted
Updated 9-Jan-22 1:23am
v5

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900