Git Product home page Git Product logo

Comments (7)

panzerdp avatar panzerdp commented on June 16, 2024 1

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.

from dmitripavlutin.com-comments.

AliN11 avatar AliN11 commented on June 16, 2024 1

Thanks for sharing Dmitri!

from dmitripavlutin.com-comments.

SiR-PENt avatar SiR-PENt commented on June 16, 2024

Thank you for this! I was wondering earlier this week if I had to always do this with fetch

from dmitripavlutin.com-comments.

panzerdp avatar panzerdp commented on June 16, 2024

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.

from dmitripavlutin.com-comments.

strat-x avatar strat-x commented on June 16, 2024

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.

from dmitripavlutin.com-comments.

xerosource01 avatar xerosource01 commented on June 16, 2024

Really helpful !! Thanks for the article

from dmitripavlutin.com-comments.

panzerdp avatar panzerdp commented on June 16, 2024

@xerosource01 You're welcome!

from dmitripavlutin.com-comments.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.