{"id":18021251,"url":"https://github.com/ho-cooh/typescriptdevwithvscode","last_synced_at":"2026-04-30T06:33:32.907Z","repository":{"id":112728168,"uuid":"572570921","full_name":"HO-COOH/TypeScriptDevWithVsCode","owner":"HO-COOH","description":"Guide about setting up Typescript development with node and vscode","archived":false,"fork":false,"pushed_at":"2022-11-30T15:05:22.000Z","size":399,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-04T17:25:50.014Z","etag":null,"topics":["node","typescript","vscode"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/HO-COOH.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-11-30T15:01:06.000Z","updated_at":"2022-11-30T15:06:18.000Z","dependencies_parsed_at":null,"dependency_job_id":"de11cfe3-27c9-4784-b886-ac0a43f86226","html_url":"https://github.com/HO-COOH/TypeScriptDevWithVsCode","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/HO-COOH/TypeScriptDevWithVsCode","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HO-COOH%2FTypeScriptDevWithVsCode","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HO-COOH%2FTypeScriptDevWithVsCode/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HO-COOH%2FTypeScriptDevWithVsCode/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HO-COOH%2FTypeScriptDevWithVsCode/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/HO-COOH","download_url":"https://codeload.github.com/HO-COOH/TypeScriptDevWithVsCode/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HO-COOH%2FTypeScriptDevWithVsCode/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260109462,"owners_count":22960026,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["node","typescript","vscode"],"created_at":"2024-10-30T06:09:13.635Z","updated_at":"2026-04-30T06:33:27.883Z","avatar_url":"https://github.com/HO-COOH.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# TypeScript Development with VSCode\nThis mainly serves as a reminder or \"reference\" to create a project and be able to debug it within VSCode. \nShare it freely if you find this helpful.\n\n## Prepreation\n### Install node and npm\nOpen a powershell/cmd, and type\n```\nwinget install Node.js\n```\n### Install VSCode\n\n### Create a project\nCreate a folder which contains your project, open a terminal there and type \n```\nnpm init -y\nnpm i typescript --save-dev\nnpm i -D @types/node\n```\n\nwhere `-y` means [continues without asking any questions](https://docs.npmjs.com/cli/v9/commands/npm-init#yes).\nAnd you should see this and a `package.json` created under the folder.\n\n### Modify `package.json`\n1. Change `\"type\": \"script\"` -\u003e `\"type\": \"module\"`, which would enable the ES module syntax, so you can use `import` instead of `require`, when using a module.\n2. Under the `scripts` object, add `\"build\": \"tsc\"`, which would run the typescript compiler when `build` task is executed.\n\nYour `package.json` should look like this\n```json\n{\n  \"name\": \u003cYour project name\u003e\n  \"version\": \"1.0.0\",\n  \"description\": \"\",\n  \"main\": \"index.js\",\n  \"type\": \"module\",\n  \"scripts\": {\n    \"test\": \"echo \\\"Error: no test specified\\\" \u0026\u0026 exit 1\",\n    \"build\": \"tsc\"\n  },\n  \"keywords\": [],\n  \"author\": \"\",\n  \"license\": \"ISC\",\n  \"devDependencies\": {\n    \"@types/node\": \"^18.11.9\",\n    \"typescript\": \"^4.9.3\"\n  }\n}\n```\n\n### Create `tsconfig.json`\nCreate `tsconfig.json` file, and copy the following content\n```json\n{\n    \"compilerOptions\": {\n        \"module\": \"NodeNext\",\n        \"moduleResolution\": \"NodeNext\",\n        \"target\": \"ES2020\",\n        \"sourceMap\": true,\n        \"outDir\": \"dist\"\n    },\n    \"include\": [\"src/**/*\"]\n}\n```\n\nNow you should have your two `json` files like this\n![](images/config.png)\n\n### Create source files\nCreate a folder named `src`, and in inside it, create your `index.ts`, like this\n![](images/structure.png)\n\nNow you should be able to run and debug with `F5` inside VsCode.\n![](images/debug.png)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fho-cooh%2Ftypescriptdevwithvscode","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fho-cooh%2Ftypescriptdevwithvscode","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fho-cooh%2Ftypescriptdevwithvscode/lists"}