ts-node-dev-env

Setup VSCode, EditorConfig, ESLint, and Prettier configurations for a TypeScript and NodeJS development environment

Usage no npm install needed!

<script type="module">
  import tsNodeDevEnv from 'https://cdn.skypack.dev/ts-node-dev-env';
</script>

README

What is this?

- Plan on developing a 'Typescript + NodeJS application'?
- This tool helps you by setting up your VSCode development environment.

Installation:

npm:
- `npm install -g ts-node-dev-env`

yarn:
- `yarn add -g ts-node-dev-env`

How to use:

- Go to the root folder of your project and run:
- `ts-node-dev-env`
- Choose your options in the console.
- After that, the files are generated!

This package will:

  • Initialize npm in your folder.

  • Create and define the following confiuration files:

Default folders: - /dist - /src

Default files: - /src/server.ts - /src/app.ts

Default environment configuration: - /.vscode/settings.json - /.editorconfig - /.prettierrc.json - /.eslintignore - /.gitignore - /.env

  • Install de following dependencies:

    - express, dotenv, cors and axios.
    
    - (dev) 
        -typescript 
        -eslint 
        -prettier
        -eslint-config-prettier
        -eslint-plugin-prettier
        -ts-node-dev
        -@types/node
        -@types/express
    
  • Initialize TypeScript Compiler:

    • tsc --init
      • creating the tsconfig.json file as a result.
  • Initialize ESLint:

    • eslint --init

      • creating the .eslintrc.json file as a result
    • options for the eslint configuration: - check synthax, find problems and enforce code style - JavaScript Modules (import/export) rather than CommonJS (require/exports) - react x vue x none V - TS Yes - Only Node - choose your style. - .eslintrc.json file format - Yes if using npm - No! if using yarn - then: - yarn add -D deps

  • Setup scripts in package.json:

    - 	"dev:": "tsnd --transpile-only --ignore-watch node_modules --respawn src/server.ts",
    - 	"build": "tsc -p .",
    - 	"start": "node dist/server.js"