4min chapter

Syntax - Tasty Web Development Treats cover image

570

Syntax - Tasty Web Development Treats

CHAPTER

Importing a Node, Is It a Require?

There's no underscore underscore, surname, no underscore underscore file name. You have to define this every single time in your file or you can make a function that passes import meta URL. TypeScript is the goat here, because it is in a space where you can mix and match the two. I wanted to first move to 100% to ESM before I did the full TypeScript rewrite. It's so much clearer. But TypeScript makes a lot of this much, much easier for you.

00:00

Get the Snipd
podcast app

Unlock the knowledge in podcasts with the podcast player of the future.
App store bannerPlay store banner

AI-powered
podcast player

Listen to all your favourite podcasts with AI-powered features

Discover
highlights

Listen to the best highlights from the podcasts you love and dive into the full episode

Save any
moment

Hear something you like? Tap your headphones to save it with AI-generated key takeaways

Share
& Export

Send highlights to Twitter, WhatsApp or export them to Notion, Readwise & more

AI-powered
podcast player

Listen to all your favourite podcasts with AI-powered features

Discover
highlights

Listen to the best highlights from the podcasts you love and dive into the full episode