Express with TypeScript's application generator.
Creates a new express application similar to the express-generator module. Except this new application is configured to use TypeScript instead of plain JavaScript.
NodeJS is great for the rapid development of web-projects, but is often neglected because of the lack of type-safety. TypeScript solves this issue and (along with its linter file) can even make your code more robust than some other static languages like Java.
There are some other tools out there to generate express apps with TypeScript such as express-generator-ts, but these either haven't been updated in a while or install a lot of junk in your project (such as an ORM).
Due to the heavy use of single-page-applications, no view-engine is configured by default. Express is only setup with the minimal settings for calling APIs and serving an index.html file. All the tools you need to run for development (while restarting on changes), building, testing, and running for production are packaged with this library.
$ Just use 'npx'
Or
$ npm install -g express-generator-typescript
The quickest way to get started is use npx and pass in the name of the project you want to create. If you don't specify a project name, the default express-gen-project will be used instead.
Create the app:
$ npx express-generator-typescript "project name"
Start your express-generator-typescript app in development mode at http://localhost:3000/
:
$ cd "project name" && npm run start-dev
- Run the server in development mode:
npm run start-dev
. - Run all unit-tests:
npm test
. - Run a single unit-test:
npm test -- "name of test file (i.e. Users)"
. - Build the project for production:
npm run build
. - Run the production build:
npm start
.