Skip to content

npmstudy/your-first-nodejs-helloworld-with-ts

Repository files navigation

Your first Node.js Helloworld with TypeScript

build status codecov

What is in this repository?

  • use tsx as typescript register & executor
  • use tsup as transpiler from ts to esm
  • use tsd as type test runner
  • use tsdoc as document
  • use Node.js v20 test runner
  • use c8 for coverage

Usages

install dependency

$ npm i

run test suite

$ npm test

transpile ts to esm for release

$ npm build

Support 2 ways to debug in vscode

1、run with node --inspect

$ npm run debug

in .vscode/launch.json

  {
      "name": "Attach to tsx",
      "port": 9229,
      "request": "attach",
      "skipFiles": [
        "<node_internals>/**"
      ],
      "type": "node"
    },

2、run directly in .vscode/launch.json

    {
      "name": "debug with tsx loader",
      "type": "node",
      "request": "launch",
      "runtimeArgs": [
        "--loader",
        "tsx"
      ],
      "skipFiles": [
        "<node_internals>/**"
      ],
      "program": "${workspaceFolder}/src/main.ts",
      "outFiles": [
        "${workspaceFolder}/**/*.js"
      ]
    }

Requirements

  • Node.js v20
  • TypeScript 5+

License

MIT @ npmstudy

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published