{"id":20215228,"url":"https://github.com/janluksoft/node_express_typescript_starter","last_synced_at":"2025-10-20T08:15:56.785Z","repository":{"id":220214008,"uuid":"748229994","full_name":"janluksoft/Node_Express_TypeScript_starter","owner":"janluksoft","description":"Starter - basic application/description for creating Node Express TypeScript applications","archived":false,"fork":false,"pushed_at":"2024-01-25T14:54:29.000Z","size":129,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-13T21:44:55.421Z","etag":null,"topics":["express","node","node-backend","node-express","nodejs","starter","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/janluksoft.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}},"created_at":"2024-01-25T14:48:45.000Z","updated_at":"2024-01-31T20:09:52.000Z","dependencies_parsed_at":"2024-01-31T22:26:42.028Z","dependency_job_id":null,"html_url":"https://github.com/janluksoft/Node_Express_TypeScript_starter","commit_stats":null,"previous_names":["janluksoft/node_express_typescript_starter"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/janluksoft%2FNode_Express_TypeScript_starter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/janluksoft%2FNode_Express_TypeScript_starter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/janluksoft%2FNode_Express_TypeScript_starter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/janluksoft%2FNode_Express_TypeScript_starter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/janluksoft","download_url":"https://codeload.github.com/janluksoft/Node_Express_TypeScript_starter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241652964,"owners_count":19997578,"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":["express","node","node-backend","node-express","nodejs","starter","typescript"],"created_at":"2024-11-14T06:20:36.312Z","updated_at":"2025-10-20T08:15:51.732Z","avatar_url":"https://github.com/janluksoft.png","language":"TypeScript","readme":"## About Node Express TypeScript starter\n\nTo write communication for Node Express in TypeScript, you need to properly configure \nthe startup project, because simply converting the declarations and .js files to .ts is not enough.\n\nFor React applications, there is an easy way to create a ts application with the command: \n[npx create-react-app my-ts-app --template typescript].\nThere is probably no such easy way for Node, so you have to take the long way as below (or use this starter)\n\n## Application development method\n\nNode Express TypeScript starter:\n- Create a project folder, e.g. [node_express_ts] and enter it (cd node_express_ts);\n- Create the default project configuration [package.json file] with the command: [npm init -y];\n- Add the Express framework and TypeScript language with the commands:\n\n        npm install express \n        npm install typescript ts-node @types/node @types/express --save-dev\n\n- Create the default TypeScript configuration [tsconfig.json file] with the command: [npx tsc --init];\n- In the [tsconfig.json] file, uncomment and add:\n        \n        \"rootDir\": \"./src\",\n        \"outDir\": \"./dist\",\n        \"moduleResolution\": \"node\", // (or \"node10\")\n- In the project, create folders: [/src], [/dist];\n- In the [node_express_ts/src] folder, create the file [node_express_ts\\src\\index.ts] and enter:\n\n        import express from 'express';\n        const app = express();\n\n        app.get('/', (req, res) =\u003e {\n            res.send('Well done!');\n        })\n\n        app.listen(3000, () =\u003e {\n            console.log(\n                'The application is listening on port 3000!'\n                );\n        })\n\n- In the [package.json] file, add:\n\n        \"scripts\": {\n            \"start\": \"node dist/index.js\",\n            \"dev\": \"node src/index.ts\",\n            \"build\": \"tsc -p .\",\n        },\n\n\n## Launching the application\n\n- Make changes to the [node_express_ts\\src\\index.ts] file, e.g. change the message to: [res.send('Now inner message2');]\n- Run the command: [npm run build]\n- Run the command: [npm run start]\n- Launch your browser with [http://localhost:3000/]\n\n![](jpg/Node_ts1.png)\n\nYou will receive the entry [Now inner message2] in your browser. The [build] command compiled the file [node_express_ts\\src\\index.ts] to [node_express_ts\\disc\\index.js] (because the browser does not understand ts files). The [start] command (for production) launched this js file in the browser.\nEach time you change [index.ts], you must run these two commands.\n\n## Fast developer testing\n\nThe above startup is tedious. For the developer, there is a better way:\n- When you don't have it, install [npm and nodemon]\n- In the [package.json] file, change:\n        \n        [\"dev\": \"node src/index.ts\",] to \n        [\"dev\": \"nodemon src/index.ts\",]\n\n- Run the application with the command: [npm run dev]\n\nNow when you change the content of ts files - nodemon compiles them to temporary: js on the fly and exposes the project to the browser. You just need to refresh the browser and the changes will be visible. This route does not modify the js files in [node_express_ts\\disc\\]\n\n![](jpg/Node_ts3.png)\n\n## This project\n\nThis project was created after implementing the starting method described below and can be an application for further development.\n\nProject written in Visual Studio Code;\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjanluksoft%2Fnode_express_typescript_starter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjanluksoft%2Fnode_express_typescript_starter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjanluksoft%2Fnode_express_typescript_starter/lists"}