How to Setup Node.js with TypeScript in 2023

  Рет қаралды 415,317

Beyond Fireship

Beyond Fireship

Күн бұрын

Пікірлер: 471
@chenlim2165
@chenlim2165 Жыл бұрын
Thanks for this! Setting up a new Node project in 2023 is: 1 hour setting up the build environment 1 hour setting up linting 1 hour getting webpack to work 1 more hour optimizing everything 3 hours researching Deno / Bun / Vite, then deciding it's not worth it 1 hour wondering if you're better off with plain JS 1 hour remembering what you wanted to build
@mucookul
@mucookul Жыл бұрын
That’s exactly why I skip half of that stuff
@edoardoschnell
@edoardoschnell Жыл бұрын
How is vite not worth it? 90% of use cases is just install boom works
@-rate6326
@-rate6326 Жыл бұрын
Ask c++ Devs
@kollpotato
@kollpotato Жыл бұрын
Just do bun init
@JC-fd8ho
@JC-fd8ho Жыл бұрын
about what ?@@-rate6326
@iatheman
@iatheman 2 жыл бұрын
This guy is always reminding me why I 1. Hate the JS ecosystem with a passion 2. Admire the JS developers that maintain their sanity and build stuff with it
@Caborrrl
@Caborrrl 2 жыл бұрын
Requiring the .js extension from TS was the most stupid TS idea in long time.
@thekwoka4707
@thekwoka4707 2 жыл бұрын
@@Caborrrl well, it's technically the spec. The TS system is very "what the spec is". Having unsuffixed imports is not valid js.
@filipmajetic1174
@filipmajetic1174 2 жыл бұрын
@@Caborrrl there's a compiler option "esModuleInterop" that fixes it
@Caborrrl
@Caborrrl 2 жыл бұрын
@@filipmajetic1174 No. The esModulelnterop is not for that or anything related to that. Wtf?
@iatheman
@iatheman 2 жыл бұрын
@@shapelessed Just realized my handle is the weird generated one. But I've been there with another stack, same pain.
@bellabianchi7667
@bellabianchi7667 2 жыл бұрын
OMG I literally sat there with this exact issue an hour ago and couldn’t resolve it and this appears in my subscriptions - THANK YOU!!
@MisterNorthernCanuck
@MisterNorthernCanuck Жыл бұрын
I spent 3 hours on fixing this. Thank you so much.
@ivanb493
@ivanb493 2 жыл бұрын
I feel like it might be a good idea to cover the ts-node package next time which is nice during development
@lsudo
@lsudo 2 жыл бұрын
@@vaaski that's basically react my friend
@CTSSTC
@CTSSTC 2 жыл бұрын
@@vaaski tsx is for react components; we don't need that additional weight here if you're just trying to write some non-frontend code.
@CTSSTC
@CTSSTC 2 жыл бұрын
@@alanbixby I tend to lean into ts-node, but now it's sounding like a nightmare yet again lol; I'll have to look into esbuild kit I guess lol; yet another tool :RIP: They used to say to never use ts-node for production, then you could; all the answers are an answer in one point in time and then never again down the road as they become the "wrong answer" lol I'm just glad to have node 18 here and the older versions dying off 🎉 It's all still a pain though.
@That_Darned_S
@That_Darned_S 2 жыл бұрын
@@lsudo No, we're not talking about react or jsx/tsx. Tsx is an npm package, does the same thing as ts-node but it's newer.
@danielegvi
@danielegvi 2 жыл бұрын
@@lsudo tsx is a CLI program, short for typescript execute. it uses esbuild to transpile all imports to js in memory on demand really fast. it also supports jsx/tsx the language extension, which is a bit confusing at first.
@fizzdev
@fizzdev 2 жыл бұрын
top notch video, can't wait for the 2024 guide
@nithinrajendran3091
@nithinrajendran3091 8 ай бұрын
Did the 2024 guide drop yet? bro left us hanging..
@fizzdev
@fizzdev 8 ай бұрын
@@nithinrajendran3091 sadly not.. we'll have to wait a few more months
@pyakz6474
@pyakz6474 22 күн бұрын
2024 is almost ending
@schmidtdisturbr
@schmidtdisturbr Жыл бұрын
A thousand thank-yous for this! I wish this video were linked in the TypeScript official getting started docs. As an infrequent JavaScript developer starting to dig into the TypeScript ecosystem, the legacy module situation is a huge stumbling block to get past. Love your straightforward presentation.
@CTSSTC
@CTSSTC 2 жыл бұрын
Every year for advent of code, I spend a majority of my time configuring my baseline JS/TS environment rather than working on the coding problems, which is fun because I get to see how much things have changed just like this video hits on 😆 Edit: I'm excited to see this full course and how it evolves ;D 🎉
@zettca
@zettca 2 жыл бұрын
Change to Deno. You'll get TS, top-level async, ESM, external modules, linting/formatting with 0 config
@codeman99-dev
@codeman99-dev 2 жыл бұрын
@@zettca No. I can't use Deno at work. I wouldn't learn Zig right now for the same reason. Not worth it. I need to know the node ecosystem.
@zettca
@zettca 2 жыл бұрын
@@codeman99-dev we're talking about AoC, not work.
@codeman99-dev
@codeman99-dev 2 жыл бұрын
@@zettca Yes. It is a great opportunity to catch up and learn what is new. It is hard to do that if you jump ship.
@marvinxu2950
@marvinxu2950 Жыл бұрын
@@zettca Just curious, what is AoC?
@shobhitsingh6271
@shobhitsingh6271 10 ай бұрын
Million likes for this video! I spent the entire day debugging until I stumbled upon your video. Turns out, the issue was that I was importing a common JS package without specifying {"type":"module"} in the package.json. Thank you so much! ❤❤❤❤❤
@TheBeastDispenser
@TheBeastDispenser 2 жыл бұрын
Thank you! This could not come at a better time. For the life of me I could not get TypeScript working with my GraphQL setup but your review of the tsconfig files cleared up my confusion. My main issue was needing to add the .js file extensions to the imports.
@erwin.agpasa
@erwin.agpasa Жыл бұрын
me tooooo
@ukaszzbrozek6470
@ukaszzbrozek6470 2 жыл бұрын
Why we need to target .js files when they extensions are .ts ? It is so confusing.
@stxnw
@stxnw 2 жыл бұрын
You don't. Jeff just doesn't know about the esModuleInterop option on TypeScript.
@18.j
@18.j 2 жыл бұрын
When you compile you run the .js file and you target the other .js files, typescript won't change your import to ts so you declare it with .js that's why...
@stxnw
@stxnw 2 жыл бұрын
@@18.j Wrong
@cyrus01337
@cyrus01337 2 жыл бұрын
@@stxnw How does TS handle this then?
@paoloose
@paoloose Жыл бұрын
​@@stxnw when I dont specify the files extension, "esModuleInterop" set to true gives me: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext' When using .ts files, The vscode hints say: "An import path can only end with a '.ts' extension when 'allowImportingTsExtensions' is enabled.ts(5097)" When I enable it, all errors are gone, but the typescript compiler throws: "error TS5023: Unknown compiler option 'allowImportingTsExtensions'." So weird.
@danish7335
@danish7335 7 ай бұрын
you don't know how much you helped me.. thanks mate
@codewithguillaume
@codewithguillaume 2 жыл бұрын
Yess!!!! I was hoping to see this video one day on your channel :)
@dubble_cuppachino
@dubble_cuppachino 2 жыл бұрын
The module field is pretty much abandoned. It's only really used by bundlers. The correct way to tell node how to import your code is to use the "files" and “exports” fields. Not trying to sound like a stackoverflow comment, just wanted to share a thing I picked up after diving into all this stuff recently. Excited to watch the rest, I love your content!
@itsinphy
@itsinphy 4 ай бұрын
Thanks a lot! ❤ I was able to figure this out the hard way, but I'm glad I stumbled upon this video for a) confirming that I did it correctly and b) future references. Cheers!
@Grim_Nerd
@Grim_Nerd 2 жыл бұрын
I always find myself having a mini heart attack when watching your videos because you'll occasionally hear a baby crying in the background and I ALWAYS think it's my baby. I'm literally home alone right now and still paused the video to listen out for him crying :')
@zyrenth
@zyrenth 2 жыл бұрын
Amazing tutorial, It's definitely a good tutorial for beginners, keep up the good work!
@NoPudieronConGuevara
@NoPudieronConGuevara Жыл бұрын
It's truly a peculiar experience see how this channel's owner is gradually descending into madness by the hand of web technologies mostly. I just can't look away... keep the hard work
@PetarKostadinov-e1x
@PetarKostadinov-e1x Жыл бұрын
Exactly what I needed . Perfect video!
@srinivasnahak3473
@srinivasnahak3473 Жыл бұрын
You're a magician for sure!!
@mehmetyilmaz001
@mehmetyilmaz001 Ай бұрын
Thanks for the video. very simple explanation. You solved my confusion
@gustavohenriquejunkes3276
@gustavohenriquejunkes3276 4 ай бұрын
Just soooo coool. Great video man
@joseph0x45
@joseph0x45 2 жыл бұрын
The video I never knew I needed, thanks Jeff :)
@d-landjs
@d-landjs Жыл бұрын
Excellent tutorial!
@alec-dora
@alec-dora 9 ай бұрын
Thanks a shit ton for this! I wasted so much time fixing the imports with .ts ext.
@phaZZi6461
@phaZZi6461 Жыл бұрын
i was here for the module thing, thanks
@ThePotatoChronicler
@ThePotatoChronicler 2 жыл бұрын
Deno NPM compatibility is nearly there! We're so close. Most libraries just work OOTB already. I am running from node with the speed of light my man, at least for my personal projects
@aunimhassan7465
@aunimhassan7465 2 жыл бұрын
life saver video
@rign_
@rign_ 2 жыл бұрын
I need to work with pure javascript to get CommonJS working, because of dynamically use the code and re-import it on runtime is such a blessing as well a curse. But for my project and personal works, it's perfectly fine.
@LarsRyeJeppesen
@LarsRyeJeppesen Жыл бұрын
That sounds horrific
@kklowd
@kklowd 2 жыл бұрын
Bruh how did you know I was setting up a project to with both esm and cjs you really are a wizard 👀
@voychoi9923
@voychoi9923 2 жыл бұрын
Great content as always
@shaded4438
@shaded4438 Жыл бұрын
the moth really cheered me up i cant lie
@michaelmenard8614
@michaelmenard8614 2 жыл бұрын
Awesome video! Any chance there is a pt. 2 coming with jest, eslint, prettier, and husky?
@Ma1ne2
@Ma1ne2 2 жыл бұрын
Looking forward to part two if this video in a month when all of this changed again :D
@abhaynath5833
@abhaynath5833 Жыл бұрын
Madness....... ? THIS IS JavaScript ecosystem 🔥🔥🔥🔥🔥🔥
@AnweshAdhikari
@AnweshAdhikari 2 жыл бұрын
Time travel is real! Jeff is one month ahead of us!😂❤
@SamyarBorder
@SamyarBorder Жыл бұрын
evey once in a while i come back and watch this video
@riddixdan5572
@riddixdan5572 2 жыл бұрын
I'm still confused as to why we need to specify file extention when we import. Couldn't node/TS resolve it itself based on the actual file it is importing?
@mcvgs1780
@mcvgs1780 2 жыл бұрын
I kind of remember Ryan Dahl spoke about this being needlessly complex to implement and (not so sure if I remember this right) hogs resources. If he were given a chance to do Node all over again he would not do it.
@dusliangames
@dusliangames 2 жыл бұрын
I just use tsc-alias to fix the import file extension after compiling. It's easier and cleaner. And handles the path aliasing. I would recommend using nodenext for moduleresolution, but for the module option to use esnext or commonjs
@0brine
@0brine 2 жыл бұрын
Lol i needed that exactly 2 days ago xD
@Zagoorland
@Zagoorland 2 жыл бұрын
You should make a movie about package managers, only few people know about PNPM for example, but for now it's the fastest and most space efficient solution!
@LarsRyeJeppesen
@LarsRyeJeppesen Жыл бұрын
And messy. The amount of time I have spent resolving fcked up symlinks is countless
@ggorg0
@ggorg0 2 жыл бұрын
You forgot about strict mode in tsconfig.json!
@danieldosen5260
@danieldosen5260 2 жыл бұрын
Great use of
@HackSoft
@HackSoft 2 жыл бұрын
Kudos for the concise & resourceful video 🙌
@Alex-lt4kr
@Alex-lt4kr Жыл бұрын
Thank you, i was struggling with the tsconfig trying to get the top level await feature working
@zvrk
@zvrk 2 жыл бұрын
For those that want nodemon to watch over file changes: add "ts-node": { "esm": true } to tsconfig.json And if your shell complains like mine did use ( npx nodemon src/index.ts ) this should work Also add ts-node globally with ( npm i -g ts-node ) really not sure if this is needed but I did it anyway
@ytPEDROjoao
@ytPEDROjoao 2 жыл бұрын
You saved me, thank you!
@LarsRyeJeppesen
@LarsRyeJeppesen Жыл бұрын
OR us tsup --watch
@flatmapper
@flatmapper Жыл бұрын
Love it! Looking forward to watching your full course. But please do it for experienced developers too
@joseandkris
@joseandkris Жыл бұрын
This is amazing. Thank you :)
@xDemorn
@xDemorn 2 жыл бұрын
Can you make a tutorial on how to host a node app on IIS?
@steveanthonyluzquinosagama7450
@steveanthonyluzquinosagama7450 2 жыл бұрын
That's exactly why I created typescript-project-generator. It will handle all the configs for using TS with Node.js. Give it a try :)
@ballballballballballball
@ballballballballballball 2 жыл бұрын
As someone in 2023, I can confirm this is how you setup Node.js with TypeScript
@ballballballballballball
@ballballballballballball 2 жыл бұрын
@@minorikoaki No, other way around
@LarsRyeJeppesen
@LarsRyeJeppesen 2 жыл бұрын
No no no, don't use tsc, and don't use ts-node.
@ballballballballballball
@ballballballballballball 2 жыл бұрын
@@LarsRyeJeppesen Sorry, in 2023, we still use tsc for some reason... I don't make the rules
@tacticalassaultanteater9678
@tacticalassaultanteater9678 2 жыл бұрын
It's important to highlight that this is only one way to set up Typescript with Node in 2023. I have different priorities, revolving more around minimizing surprises than around efficiency, so I do almost everything differently, and I don't expect my values to turn around completely next year either. This tutorial is valuable because it's a complete description of an error-free setup, not because the statements within are universally optimal.
@DemPilafian
@DemPilafian 2 жыл бұрын
It feels like this message is trying to tell us something without actually saying what it is. Or maybe I'm just missing something obvious. Can someone express the "different priorities" in more blunt terms?
@asiraky
@asiraky 2 жыл бұрын
Or just use ts-node
@resourcelookup8678
@resourcelookup8678 2 жыл бұрын
Super
@usd00
@usd00 2 жыл бұрын
Is it only me who feels like Jeff's voice is changing constantly over the video...?
@GuildOfCalamity
@GuildOfCalamity Жыл бұрын
Great video. This reminded me of the reason I don't like web dev... too many moving parts just to get a simple webpage to run.
@EdharEzenvaAvuzi
@EdharEzenvaAvuzi Жыл бұрын
Thank you so much!
@stefankracht
@stefankracht 2 жыл бұрын
Good timing on that video, since advent of code is around the corner ❤
@VideoBunt
@VideoBunt 2 жыл бұрын
1) ts-node + nodemon could be very helpful 2) npm i tsconfig@ for certain node version could be helpful, just extends it
@stxnw
@stxnw 2 жыл бұрын
no. ts-node is trash
@VideoBunt
@VideoBunt 2 жыл бұрын
@@stxnw why? And what can replace it?
@stxnw
@stxnw 2 жыл бұрын
@@VideoBunt swc-node
@LarsRyeJeppesen
@LarsRyeJeppesen Жыл бұрын
ts-node is horrible. Do not use it please
@LarsRyeJeppesen
@LarsRyeJeppesen Жыл бұрын
@@VideoBunt tsup (esbuild) in watch mode
@grantdoyle1259
@grantdoyle1259 2 жыл бұрын
2023? Getting a little ahead of ourselves aren't we?
@thepowerhat
@thepowerhat 2 жыл бұрын
For developing nodejs backend, I generally use babel with watch mode and nodemon to have very fast server restart on file save. I'll check this out but I'll probably still prefer sticking with a faster transpiler than tsc
@double-agent-ly
@double-agent-ly 2 жыл бұрын
why use babel when u have vite or even the newer tool, rome
@thepowerhat
@thepowerhat 2 жыл бұрын
@@double-agent-ly Vite for backend? Hmm
@fred.flintstone4099
@fred.flintstone4099 2 жыл бұрын
For developing frontend I use Vite for very fast hot reload on file save.
@shubitoxX
@shubitoxX 2 жыл бұрын
Babel is not fast
@thepowerhat
@thepowerhat 2 жыл бұрын
​@@shubitoxXSure faster than tsc, because it just ignores the types, it doesn't type validate the AST like tsc does..
@abdulazeem1880
@abdulazeem1880 2 жыл бұрын
Please make a video on pr-commit hooks
@nicholaskoffler294
@nicholaskoffler294 2 жыл бұрын
looking forward to that typescript course
@Steve-Richter
@Steve-Richter Жыл бұрын
was hoping you would cover how to run the equivalent of nodemon when a change is made to the typescript source code.
@Zwiebelgian
@Zwiebelgian 2 жыл бұрын
Deno now supports npm (atleast that is what their propaganda says) so now may be a good time to switch
@brucewayne2480
@brucewayne2480 2 жыл бұрын
Why ? I just want to know what will you gain ?
@Zwiebelgian
@Zwiebelgian 2 жыл бұрын
@@brucewayne2480 Built-in Typescript support, better speed, cleaner directories. I don‘t actually know, I am not a backend developer
@brucewayne2480
@brucewayne2480 2 жыл бұрын
@@Zwiebelgian it's not a lot of work to setup a typescript project , cleaner directories I'm not seeing any problem, speed not sure , I've not seen any benchmarking
@jakob7116
@jakob7116 2 жыл бұрын
@@Zwiebelgian yeah, it also has better apis under the Deno. namespace and a std library. You also get less config files, lots of built in stuff like linter so you don’t have to do that yourself, more secure, faster http server, better browser compatibility, the apis mostly use promises (and sync versions) instead of callbacks, you can run code directly from a url, even Ts code and so on The npm support doesn’t work on all packages perfectly just yet but soon:tm:
@Dominik-K
@Dominik-K 2 жыл бұрын
For me personally the sandboxing capabilities are nice
@Mauro-K
@Mauro-K 2 жыл бұрын
I like the video, I hated the topic, but it was good content
@kalebercanbrack8857
@kalebercanbrack8857 2 жыл бұрын
Just yesterday I was dealing with something similar with Fastify and Typescript. I wanted to be using ESM, and went through the whole troubleshooting process to figure out the right tsconfig settings, but due to the way a lot of Fastify packages were exporting their types it broke being able to import the default export from it. I don't know the specifics, but it was just super annoying that this glorified linter was causing such an obnoxious bug for code that worked fine without it. However, Typescript in Deno is a beautiful experience. Largely I think because you don't have to worry about commonJS. Makes me wonder if as Deno gets more popular, the TS Node people will move over to it
@vaultofmyths
@vaultofmyths Жыл бұрын
Except deno breaks your code in ways you can't imagine because of their weird engine
@mmvarma.p
@mmvarma.p 2 жыл бұрын
Great video as always. From 3.09 secs to 3.28 secs, your voice sounded different. Is it me or has anyone noticed it? R u well bro. Please stay safe and sound. Looking forward to your next video.
@beyondfireship
@beyondfireship 2 жыл бұрын
I have a cold. Nothing serious
@akshattamrakar9071
@akshattamrakar9071 2 жыл бұрын
I was thinking the same
@kvelez
@kvelez 3 ай бұрын
Good video. tsconfig.json (just create the ./scr and ./dist directories): { "compilerOptions": { "target": "ESNext", "module": "commonjs", "esModuleInterop": true, "forceConsistentCasingInFileNames": true, "strict": true, "skipLibCheck": true, "rootDir": "src", "outDir": "dist", }, "include": [ "src/**/*.ts" ], "exclude": [ "node_modules", "test", "dist", ] }
@אלעדר
@אלעדר Жыл бұрын
Excellent!
@bensas42
@bensas42 2 жыл бұрын
I had to do this last week haha
@kumekster
@kumekster 2 жыл бұрын
Maybe quick guide here on how to set eslint?
@ertagon
@ertagon 2 жыл бұрын
Do Babel next.
@letsoverengineer
@letsoverengineer 2 жыл бұрын
The moment when you insert a voice over from another recording session x)
@dusliangames
@dusliangames 2 жыл бұрын
Importing a js file in typescript that doesn't exist on the file system is really confusing and simply weird. It's way better to use a tool like tsc-alias to fix the imports as a compilation step instead of having to change every import of every source file in every project.
@vikingthedude
@vikingthedude 2 жыл бұрын
Yeah I don’t like it
@adam-user
@adam-user Жыл бұрын
Is there a way to resolve this that works both during compile time and in VSCode?
@salsichalivre5401
@salsichalivre5401 2 жыл бұрын
Great, I only needed 3 minutes to give up on frontend dev.
@themarksmith
@themarksmith 2 жыл бұрын
How about a demo on how to make a basic PWA?
@Dysfunctional704
@Dysfunctional704 2 жыл бұрын
Can you make a video on the T3 Stack from Theo?
@Alex-hk3hr
@Alex-hk3hr 2 жыл бұрын
Thanks for a great tutorial and a perfect argument why not to use JS/TS ; )
@Roman-of9pl
@Roman-of9pl 2 жыл бұрын
Every time someone is sharing their project setup I recall that scene from American Psycho.
@NareshKumar-vt4sh
@NareshKumar-vt4sh 6 ай бұрын
Thanks a lot.
@LarsRyeJeppesen
@LarsRyeJeppesen 2 жыл бұрын
tsc? What about Turbo, EsBuild etc? Why use npm when we have pnpm?
@xrr-1
@xrr-1 2 жыл бұрын
0:45 javascript at its peak
@ricardorien
@ricardorien 2 жыл бұрын
Express + TypeScript, please. With nice paths like "import ASDF from @componets/navbar" Please!
@angelhdzdev
@angelhdzdev 2 жыл бұрын
Just add the path alias in tsconfig.json for the "@components" or even better, just point "@" to the src folder, so you can "@/anything". Then, install @types/node and @types/express as development dependencies. If you use dotenv and cors, install @types/dotend and @types/cors.
@LarsRyeJeppesen
@LarsRyeJeppesen Жыл бұрын
@@angelhdzdev That won't work well in many environments.
@angelhdzdev
@angelhdzdev Жыл бұрын
@@LarsRyeJeppesen yeah, there are a lot of issues in Node and TypeScript, and each bundler have its own solutions. But for now, that's the solution and packages like module-alias or better-module-alias. But if you know of a better solution, please comment it instead of being secretive about it. Cheers!
@shapelessed
@shapelessed 2 жыл бұрын
npm init tst --init Done. Now, my way of doing this is (as a proud developer) is scripting all of this. Hosting CommonJS and ESM project templates on a NodeJS-based, fully automated file server that's using my own database that's using its own virtual file system and cloning it whenever I need. Yes It's overcomplicated for a reason don't argue just accept that life isn't always the way it should be.
@eestpavel
@eestpavel 2 жыл бұрын
Lately I found myself better setting vite-node rather than trying to set all that experimental flags to run my code with modern day devfeatures
@davidnagli
@davidnagli 2 жыл бұрын
Funny how this video is only a day old and I already out of date with the new Node 19 release (which supports imports without the .js file extension)
@rofgar
@rofgar 2 жыл бұрын
Very good guide, amazingly frustrating topic.
@NomadSWE
@NomadSWE Жыл бұрын
Do the course in strict:true mode pls.
@kishiue
@kishiue 2 жыл бұрын
I'd advise using a runner like TSX or Esbuild runner. This strips the types and makes it much less painful to develop. Type checking is gradually moving in the direction of being a CI step rather than part of the build step.
@LarsRyeJeppesen
@LarsRyeJeppesen 2 жыл бұрын
Agree, TSX or Esbuild - or Turbo
@marna_li
@marna_li 2 жыл бұрын
I went through this a couple of months ago. But there might be some starter templates. At least there should be one.
2 жыл бұрын
Don't forget to add the "--enable-source-maps" flag when running your compiled code with node, otherwise the sourcemaps will be ignored.
@Neuer_Alias_erstellen
@Neuer_Alias_erstellen 2 жыл бұрын
is that what learning traditional Chinese feels like
@himawaridev
@himawaridev 4 ай бұрын
use full bro
@jaroslavhuss7813
@jaroslavhuss7813 2 жыл бұрын
Nah, this is one of the reasons why I use Nest.js - TypeScript by default, no hassle, no cry - just awesome architecture, typescript and more time for playing Witcher 3 after the work is done.
@Mewgu_studio
@Mewgu_studio 2 ай бұрын
Thanks thanks thanks!!!
@wlockuz4467
@wlockuz4467 2 жыл бұрын
Is there an easy way to emit non-js files from src? For instance images or csv. I hate using 10 different packages to copy the files after compiling or making a complicated build system for a very simple project.
@krishgarg2806
@krishgarg2806 2 жыл бұрын
can you cover how to really create a backend API with express which can scale? Like express doesn't offer good auto error handling, which just results in a lot of try catch blocks. Everytime I think of starting a backend project, Express is the first thing that comes in mind because it is the most famous one. But writing anything with it feels like practicing or bad code practice. Basically I am asking for a structured way to use express for a backend api.
@VitalMercenary
@VitalMercenary 2 жыл бұрын
I want this as well
@coffee-is-power
@coffee-is-power 2 жыл бұрын
Use fastify.
@DarkzarichV2
@DarkzarichV2 2 жыл бұрын
Use something like joi for body validation and clean architecture to build an app
@mytho2630
@mytho2630 2 жыл бұрын
You can try NestJS. It has the structure you are looking for. It can use fastify or express under the hood. However, you usually work above that unless you need something really specific. Although JS is supported, its best to use typescript. The main point of the framework is program structure. Each part of your app (controllers, services, guards, interceptors, etc) are built to be reused and easily manageable. I could talk more about it but their documentation is pretty good.
@okie9025
@okie9025 2 жыл бұрын
As somebody else already said, NestJS is probably what you're are looking for if you want a robust and fast NodeJS backend framework.
@djibrilmugisho5874
@djibrilmugisho5874 2 жыл бұрын
I think you should add the watch option for watching new changes instead of compiling everything manualy
@himanshukapoor5586
@himanshukapoor5586 8 ай бұрын
"noEmit": true, "allowImportingTsExtensions": true, adding these two will allow you to import ts files as .ts files only.
@nithinraj1428
@nithinraj1428 Жыл бұрын
Thank You
@martinzen
@martinzen 2 жыл бұрын
I have trouble deciding if the best thing about your videos are the software parts of the meme parts...
How to Setup Node.js and TypeScript
20:18
Better Stack
Рет қаралды 3 М.
How To Use TypeScript With Express & Node
17:05
Colt Steele
Рет қаралды 75 М.
It works #beatbox #tiktok
00:34
BeatboxJCOP
Рет қаралды 41 МЛН
Is Next.js 15 any good? "use cache" API first look
8:16
Beyond Fireship
Рет қаралды 128 М.
Express JS with TypeScript - Setup, Examples, Testing
1:20:13
Anson the Developer
Рет қаралды 46 М.
How I deploy serverless containers for free
6:33
Beyond Fireship
Рет қаралды 582 М.
PROOF JavaScript is a Multi-Threaded language
8:21
Beyond Fireship
Рет қаралды 294 М.
TypeScript and NodeJS: The Proper Setup!
13:49
Josh tried coding
Рет қаралды 53 М.
How to use TypeScript with React... But should you?
6:36
Fireship
Рет қаралды 949 М.
Node.js is a serious thing now… (2023)
8:18
Code With Ryan
Рет қаралды 663 М.
Does Deno 2 really uncomplicate JavaScript?
8:55
Beyond Fireship
Рет қаралды 477 М.
Learn TypeScript Generics In 13 Minutes
12:52
Web Dev Simplified
Рет қаралды 293 М.
Typescript API in NodeJS / Express in Depth [Part 1]
38:10
The Nerdy Canuck
Рет қаралды 14 М.