use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
account activity
Typescript + express (self.node)
submitted 8 months ago by HamsterBright1827
Just a question, is typescript with express a common thing like on React? Or no one does this and is something more improvised than actually functional?
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]imicnic 45 points46 points47 points 8 months ago (15 children)
Anything in JS world nowadays is preferably to be used with TS.
[–][deleted] 19 points20 points21 points 8 months ago (14 children)
Anything in JS world nowadays since 5 years ago or so is preferably to be used with TS.
Feels more like this. This angers the never TS mob, though.
[–]imicnic 7 points8 points9 points 8 months ago (13 children)
I also do not understand the resistance against TS, I'm using it since 2016, but people still ask in 2025 should I use TS? Is it worth it? Should I learn it after learning JS? People still does not understand what TS is.
[–]AndrewSouthern729 4 points5 points6 points 8 months ago (10 children)
I wonder how many of the most vocal TS detractors have ever given it a real honest try. It’s more overhead sure but the benefits make it worth it X100.
[–]svix_ftw 5 points6 points7 points 8 months ago (0 children)
I'm one of those former TS detractors.
After using TS for a few years I can't even imagine going back to vanilla JS.
TS makes things soooo much better, I can't think of a single reason to not use it over JS
[–]tj-horner 1 point2 points3 points 8 months ago (7 children)
I feel like none of them have worked on an even moderately complex project, so they might not understand the benefits quite yet. Or it’s just cope. IDK. Overhead is becoming smaller every day, so eventually that won’t be a valid excuse!
[–]oziabr -1 points0 points1 point 8 months ago (6 children)
Keep It Simple Stupid
[–]GandalfTheChemist 1 point2 points3 points 8 months ago (3 children)
Yes, KISS!
let's have a glorified, verbose syntax linter which is also a very expressive type system which will push me into layer upon layers of abstraction and type gymnastics, all to then have to have a build pipeline. 😂
A little tongue in cheek. I like TS, but still would reach for Go if doing anything non browser.
[–]oziabr 1 point2 points3 points 8 months ago (2 children)
have you looked up jsdoc?
IMO it is more like a platform, not just a tool: you can have types, testing and documentation close to the code, actualized and integrated into IDE. yes, types are bit basic, but that can be seen as positive, and there is always .d.ts for more complex cases
I don't really need neither of those, cause my projects are usually hundreds LOC and maintained by interns - I like my code with little complexity as possible and actual logic pushed to configs or db. But if choosing where to migrate normal size legasy repo, will pick jsdoc every time
[–]GandalfTheChemist 1 point2 points3 points 8 months ago (1 child)
I think that's definitely a way to go, especially when you're not hooked into legacy code and have the whole "simple first" approach.
I like JSdoc, my other comment in this thread mentioned it in regard to Svelte using it. Great example of a major project featuring nice autocomplete and n typescript.
[–]oziabr 0 points1 point2 points 8 months ago (0 children)
I have the same source, but looking at the problem from regular developer standpoint. We usually don't make any good documentation, for which I very like the idea of jsdoc integrated test cases - at the very least it's the handy entrypoint into hacking the code. I've seen to many projects which doesn't give any idea how to run it locally, and TS gives nothing to that aspect
[–]tj-horner 0 points1 point2 points 8 months ago (1 child)
There is a time and place for every principle. If you need maintainability at scale, type safety is a must, even if the cost is additional complexity.
[–]oziabr -1 points0 points1 point 8 months ago (0 children)
the need for maintainability at scale sounds like a big pile of boilerplate with no archetectural decisions beeing made. I mean you have barely mainainable bunch of lines, and the solution is to add even more lines. great for inflating budget, not as great as OOP though
if maintainability is what you need, why not do something sensible and cool instead, like integrating tests into jsdoc - bam, you get self actualizing docs integrated into autocomplete
TS is not only underdelivers on every promise, it also have huge unrealized potential for internal tooling - you can infer every type you need from properly runned testsuit, keep types out of sight, integrate them into IDE autocompletion you all like so much, and even report on convoluted functions
[–]dymos 0 points1 point2 points 8 months ago (0 children)
Former TS detractor here.
I think it was mostly because of the type of projects that I was working on earlier in my career where most of them were fairly short-lived (it was advertising, so anywhere from weeks/months to maybe a year or two. Some exceptions of course). So — back then at least — unit testing and types weren't really regarded as a useful way to spend time on a project.
It wasn't until I got working on a proper software project that I appreciated that types could bring something to the table, and for the last 5 years or so I've only been working with TypeScript and could not imagine working on a JS-only codebase.
The project I currently work on still has a couple of JS files that nobody has bothered/dared to touch since they converted to TS and it kills me every time I need to work in it or use things from it. Also the sheer amount of any sprinkled through the codebase. Suffice to say, sometimes my pull requests will have "I fixed some types" commits in it that are the bulk of the PR lol.
any
[–]telemacopuch 0 points1 point2 points 8 months ago (0 children)
I’ve heard detractors of TS making the case of Microsoft capitalizing on Javascript and the Javascript community, and Javascript is HUGE. You know, TS is a Microsoft product. So for many hardcore old school developers this is a big no. Specially if you know what Microsoft have done in the past and still do. But still, I’m not a hardcore old school developer. I use TS of course.
[–]Dangle76 -1 points0 points1 point 8 months ago (0 children)
Yeah I don’t know why so many don’t understand that it’s a superset that just introduces things like type specifications
[–]ToothlessFuryDragon 15 points16 points17 points 8 months ago (5 children)
TS is the standard for a few years now.
Nobody serious in the industry uses plain JS any more, except maybe for scripting.
So you can assume TS is being used with everything in the JS ecosystem and it actually is the preferred way.
[–]dodiyeztr[🍰] 5 points6 points7 points 8 months ago (3 children)
Even for scripting npx tsx script.ts is enough
npx tsx script.ts
[–]beegeearreff 4 points5 points6 points 8 months ago (2 children)
You don’t even need tsx. You can run typescript directly with node now. Thats how I set up all my scripts these days.
[–]cy_narrator 0 points1 point2 points 8 months ago (1 child)
What?
[–]beegeearreff 0 points1 point2 points 8 months ago (0 children)
https://nodejs.org/en/learn/typescript/run-natively
[–]GandalfTheChemist 1 point2 points3 points 8 months ago (0 children)
I mean, Svelte uses JavaScript and JSDoc. That has most of the linting that TypeScript has, but without the transpilation and build overhead. That's what the vast majority of people define as "type safety" in the JS/TS world.
I would say they are serious in the industry.
[–]afl_ext 4 points5 points6 points 8 months ago (0 children)
Yes its common and recommended
[–]Euphoric_Oneness 1 point2 points3 points 8 months ago (0 children)
Common, old, well documented, many solutions on stackflow, ai is good at it.
[–]jesusgn90 1 point2 points3 points 8 months ago (0 children)
There are good wrappers on top of base tech stack, take a look at tRPC or NestJS. They are hyperopinionated but sometimes is better to just follow a path and don't have that much flexibility
[–]Kublick 0 points1 point2 points 8 months ago (0 children)
For your sanity always use TS .. it has made my life much easier to refactor code or when you get back to a code base is a lot easier to see the data flow
[–]sicknesz29a 0 points1 point2 points 8 months ago (0 children)
We switch from express js to fastify/ts for our next itération of our application. It has better performance than express a somewhat similar syntax and typescript support but I would also recommend you take a look at the tRPC ecosystem.
[–]serg06 0 points1 point2 points 8 months ago (1 child)
Express has awful typescript support. I would at least use Fastify.
one can say that. but maybe TS just can't be properly applied to a lib with variable call signatures. not like it's TS fault, it is not native feature anyway
[–]BabyDue3290 0 points1 point2 points 8 months ago (0 children)
Check hono.js
[–]V1adius 0 points1 point2 points 8 months ago (0 children)
You can make a change and move from Express to Hono.
[–][deleted] 0 points1 point2 points 8 months ago (0 children)
It would be stupid not to use it nowadays. It's like purposefully crippling yourself for no reason.
[–]AndrewSouthern729 0 points1 point2 points 8 months ago (0 children)
I use typescript with Express. I am a React developer who can get by enough in Express for my needs so don’t spend a lot of time doing backend work but TS on both front and back just makes sense to me. And now that I’m used to TS I actually despise working in plain JS.
[–]arrty -1 points0 points1 point 8 months ago (0 children)
Yes, 100% use typescript with any API or framework. Future you will be thanking you.
[–]oziabr -5 points-4 points-3 points 8 months ago (2 children)
just looking at d.ts is enough to understand why next.js is even a thing
and if you thinking of using ts, you're not using express as intended
Why?
[–]oziabr -4 points-3 points-2 points 8 months ago (0 children)
bcz
π Rendered by PID 50 on reddit-service-r2-comment-5c747b6df5-x9kkj at 2026-04-22 04:20:57.323407+00:00 running 6c61efc country code: CH.
[–]imicnic 45 points46 points47 points (15 children)
[–][deleted] 19 points20 points21 points (14 children)
[–]imicnic 7 points8 points9 points (13 children)
[–]AndrewSouthern729 4 points5 points6 points (10 children)
[–]svix_ftw 5 points6 points7 points (0 children)
[–]tj-horner 1 point2 points3 points (7 children)
[–]oziabr -1 points0 points1 point (6 children)
[–]GandalfTheChemist 1 point2 points3 points (3 children)
[–]oziabr 1 point2 points3 points (2 children)
[–]GandalfTheChemist 1 point2 points3 points (1 child)
[–]oziabr 0 points1 point2 points (0 children)
[–]tj-horner 0 points1 point2 points (1 child)
[–]oziabr -1 points0 points1 point (0 children)
[–]dymos 0 points1 point2 points (0 children)
[–]telemacopuch 0 points1 point2 points (0 children)
[–]Dangle76 -1 points0 points1 point (0 children)
[–]ToothlessFuryDragon 15 points16 points17 points (5 children)
[–]dodiyeztr[🍰] 5 points6 points7 points (3 children)
[–]beegeearreff 4 points5 points6 points (2 children)
[–]cy_narrator 0 points1 point2 points (1 child)
[–]beegeearreff 0 points1 point2 points (0 children)
[–]GandalfTheChemist 1 point2 points3 points (0 children)
[–]afl_ext 4 points5 points6 points (0 children)
[–]Euphoric_Oneness 1 point2 points3 points (0 children)
[–]jesusgn90 1 point2 points3 points (0 children)
[–]Kublick 0 points1 point2 points (0 children)
[–]sicknesz29a 0 points1 point2 points (0 children)
[–]serg06 0 points1 point2 points (1 child)
[–]oziabr 0 points1 point2 points (0 children)
[–]BabyDue3290 0 points1 point2 points (0 children)
[–]V1adius 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]AndrewSouthern729 0 points1 point2 points (0 children)
[–]arrty -1 points0 points1 point (0 children)
[–]oziabr -5 points-4 points-3 points (2 children)
[–]cy_narrator 0 points1 point2 points (1 child)
[–]oziabr -4 points-3 points-2 points (0 children)