Code Monkey home page Code Monkey logo

create-express-typescript-application's Introduction

express typescript

create-express-typescript-application.

NPM Version Package License NPM Downloads Wallaby.js

Why create-express-typescript-application?

create-express-typescript-application creates a new lightweight express application which is fully customizable for your use case. With the support of TypeScript, it allows a robust NodeJS express app to serve as an RESTful backend server.

There are three modes of create-express-typescript-application, mainly:

  1. plain mode - lightweight express typescript app (--type plain)
  2. typeorm mode - lightweight express typescript app with typeorm (sqlite included) and swagger (OpenAPI documentation) integrated
  3. prisma mode - fullweight express typescript app with prisma (relational database ORM) and swagger (OpenAPI documentation) integrated

You are highly recommended to use typeorm template if database is required in this project, otherwise, plain mode.

Application Details

When you run create-express-typescript-application, it sets up a very simple application without junk packages. The src/app/sample folder shows how easy it is to create new routes.

Installation

Pre-requisite: Node, npm and git are locally installed.

Install this package globally in your environment:

$ npm install -g create-express-typescript-application

Or use npx to execute this package without installing it globally:

$ npx create-express-typescript-application

List of Generator Options

Options:
  -V, --version              output the version number
  -d, --debug                output extra debugging
  -t, --template <template>  specify only prisma, plain or typeorm
  -p, --prisma               define template prisma
  -y, --typeorm              define template typeorm
  -h, --help                 display help for command

The --prisma option integrates Prisma ORM into any of the lightweight app templates.

Quick Start

The quickest way to get started is use npx and pass in the name of the project you want to create.

Create a new Express app with the default plain template:

$ create-express-typescript-application {project-name-without-spaces}

Or create a new Express app using a specific template:

# plain (lightweight, default)
$ create-express-typescript-application {project-name-without-spaces} -t plain

# typeorm (lightweight)
$ create-express-typescript-application {project-name-without-spaces} -t typeorm

# prisma (fullweight)
$ create-express-typescript-application {project-name-without-spaces} -t prisma

Navigate into the generated folder to work on your new app:

$ cd {project-name-without-spaces}

Development Script Commands

  • Run the server in development mode: npm run dev.
    • with the default port, your app will be accessible at http://localhost:8080/.
    • if Swagger is included, your API docs will be accessible at http://localhost:8080/docs.
  • Build the project for production: npm run build.
  • Run the production build: npm start.
    • note: this requires the app to be built first.

License

MIT

create-express-typescript-application's People

Contributors

nome8888 avatar prawiragenestonlia avatar zalithka avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.