HACKER Q&A
📣 lovingCranberry

How do you set up a new TypeScript project for Node.js?


I always find me setting up typescript by hand when creating a new project.

This includes writing a nodemon-startup script in ``package.json``, setting an export for ``dist/index.js``, setting the type to module, tweaking ``tsconfig.json`` to support ES2020 or newer etc.

Is there any sane boiler plate which you use? For next.js, CRA and other web framework stuff countless typescript boilerplates exist, but I have yet to find anything which works for "normal" node.js projects.


  👤 ss108 Accepted Answer ✓
I just copy and paste from old projects like a clown.

Maybe this would be a good portfolio project thing for me to build.


👤 me_me_mu_mu
Same here. I have a scaffold I use, with a tsconfig and some other common boilerplate.

Personally I avoid using big frameworks like nest, etc. and just use my simple boiler plate and add functionality I'll need.

Most of the boilerplate I've seen on github are (imo) awfully bloated.