fastify typeScript generator: a generator for creating fastify server with typescript

now the first question first, what is fastify?

fastify logo
source: https://fastify.io/

advantages of using fastify?

  • 100% asynchronous: all the core is implemented with asynchronous code, in this way not even a millisecond is wasted.
  • highly performant: as far as we know, fastify is one of the fastest web frameworks in town, depending on the code complexity we can serve up to 20000 requests per second.
  • extendible: fastify is fully extensible via its hooks, plugins, and decorators.
fastify benchmark image
source: https://fastify.io/benchmarks/

why do we need a generator?

& so comes fastify-typescript-generator

fastify-typescript-generator npm landing image
source: https://npmjs.com/package/fastify-typescript-generator
  • using typescript in our templates for better coding standards & attain all the other benefits of typescript.
  • providing a template for people familiar with express
  • providing a template for people wanting to familiarize themselves with the concept of fastify and it’s the plugin system.
  • providing templates with the option to choose between mongoose (a well known MongoDB driver in node.js world supporting schema) & TypeORM which is an ORM that can be used to connect to various SQL as well as MongoDB database (MongoDB connection in BETA) & work with them built specifically keeping typescript in mind.
  • some templates have OpenAPI (previously Swagger) implementation
  • a cool interactive CLI

npm

https://www.npmjs.com/package/fastify-typescript-generator

how do i use it?

demo on fastify-typescript-generator usage
source: https://github.com/open-devs/fastify-typescript-generator#-demo

install

npm i -g fastify-typescript-generator

usage

fastify-gen
# or
fastify-typescript-generator
# or
fastify-ts-gen

who are we?

--

--

--

open devs is an organization of two motivated developers (@mikr1306 , @alok722 ), building open source enterprise-level software to contribute to the community.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

How to integrate WeChat payment?

How React Can Teleport Your Children to Another Component

Redux like State management without Redux

Adding TypeScript to Your React/Express App

10 Popular Java Frameworks

React.JS Series: What is JSX? And why do we need it?

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
open devs

open devs

open devs is an organization of two motivated developers (@mikr1306 , @alok722 ), building open source enterprise-level software to contribute to the community.

More from Medium

Creating Nextjs JWT token using LDAP for Authentication & Authorization & use it in Nestjs GraphQL…

login

Run Migrations Using Docker in Node.js and PostgreSQL

run migrations using docker and docker-compose

Difference Between Middleware, Interceptor, and Filter in NestJS (2022)

NodeJS & HTTP Error 431