Open utterances-bot opened 2 years ago
Thank you for this! I was wondering earlier this week if I had to always do this with fetch
Thank you for this! I was wondering earlier this week if I had to always do this with fetch
You're welcome @sukodes! Yes, including JSON natively is a must.
Thx for the article! For those trying this out I think it might be useful to highlight that import
is only available in modules. In order to let nodejs treat your js file as a module you must add "type": "module",
to your package.json.
Thx for the article! For those trying this out I think it might be useful to highlight that
import
is only available in modules. In order to let nodejs treat your js file as a module you must add"type": "module",
to your package.json.
You can also take a look at my post How to Use ECMAScript Modules in Node.js.
Thanks for sharing Dmitri!
Really helpful !! Thanks for the article
@xerosource01 You're welcome!
JSON Modules in JavaScript
How to import JSON data directly into an ES module.
https://dmitripavlutin.com/javascript-json-modules/