Giter Site home page Giter Site logo

node-typescript-server's Introduction

node-typescript-server

  1. mkdir src

  2. npm init -y

  3. npm install typings typescript --global

  4. set PATH=%USERPROFILE%\AppData\Roaming\npm;%PATH%

  5. typings init -y

  6. tsc --init

  7. change in tsconfig.json

{ "compilerOptions": { "module": "commonjs", "target": "es5", "noImplicitAny": false, "sourceMap": true, "watch": true }, "exclude": [ "node_modules" ] }

  1. npm install typings --save

  2. create tasks.json by (ctrl+shift+p) Configure Task Runner - > TypeScript โ€“ tsconfig.json

  3. for windows change in tasks.json command and args attribute

{ // See https://go.microsoft.com/fwlink/?LinkId=733558

// for the documentation about the tasks.json format

"version": "0.1.0",

"command": "node",

"isShellCommand": true,

"args": ["${workspaceRoot}\\node_modules\\typescript\\bin\\tsc"],

"showOutput": "silent",

"problemMatcher": "$tsc"

}

  1. Add a .typingsrc to setup proxy at the root of the project folder with below two lines

proxy=http://proxy.threatpulse.net:8080 rejectUnauthorized=false

  1. execute the below commands

typings install dt~node --save --global

typings search node

  1. stop and start compiler in visual stuio code

  2. Add a index.ts under src folder

  3. Add a launch.json by (ctrl+shift+p) Open launch.json, update with below content

{ "version": "0.2.0",

"configurations": [
    
 {

        "name": "Launch",

        "type": "node",

        "request": "launch",

        "program": "${workspaceRoot}/src/index.ts",

        "stopOnEntry": false,

        "args": [],

        "cwd": "${workspaceRoot}",

        "preLaunchTask": null,

        "runtimeExecutable": null,

        "runtimeArgs": [

            "--nolazy"

        ],

        "env": {

            "NODE_ENV": "development"

        },

        "console": "internalConsole",

        "sourceMaps": true,

        "outFiles": [ ]

    },

    {

        "name": "Attach",

        "type": "node",

        "request": "attach",

        "port": 5858,

        "address": "localhost",

        "restart": false,

        "sourceMaps": false,

        "localRoot": "${workspaceRoot}",

        "remoteRoot": null

    }
]

}

  1. npm install eslint --save-dev
  2. npm install eslint-plugin-import --save-dev
  3. npm install eslint-plugin-node --save-dev
  4. npm install eslint-plugin-promise --save-dev
  5. npm install eslint-plugin-standard --save-dev

node-typescript-server's People

Contributors

rupesh-papneja avatar

Watchers

James Cloos 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.