{"id":5824,"date":"2021-05-31T13:01:10","date_gmt":"2021-05-31T13:01:10","guid":{"rendered":"https:\/\/nlineaxis.com\/?p=5824"},"modified":"2021-09-14T12:41:30","modified_gmt":"2021-09-14T12:41:30","slug":"how-to-work-with-typescript-in-a-node-js-project-with-express","status":"publish","type":"post","link":"https:\/\/nlineaxis.com\/blog\/how-to-work-with-typescript-in-a-node-js-project-with-express\/","title":{"rendered":"How to work with TypeScript in a Node.js Project with Express"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_79 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/nlineaxis.com\/blog\/how-to-work-with-typescript-in-a-node-js-project-with-express\/#What_is_TypeScript\" >What is TypeScript?<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/nlineaxis.com\/blog\/how-to-work-with-typescript-in-a-node-js-project-with-express\/#1_Setting_up_our_project\" >1. Setting up our project<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/nlineaxis.com\/blog\/how-to-work-with-typescript-in-a-node-js-project-with-express\/#2_Add_the_required_dependencies\" >2. Add the required dependencies<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/nlineaxis.com\/blog\/how-to-work-with-typescript-in-a-node-js-project-with-express\/#3_Configuring_TypeScript_as_per_our_requirement\" >3. Configuring TypeScript as per our requirement:<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/nlineaxis.com\/blog\/how-to-work-with-typescript-in-a-node-js-project-with-express\/#4_Create_an_Express_server\" >4. Create an Express server<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/nlineaxis.com\/blog\/how-to-work-with-typescript-in-a-node-js-project-with-express\/#5_Accessing_the_Created_scripts\" >5. Accessing the Created scripts<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/nlineaxis.com\/blog\/how-to-work-with-typescript-in-a-node-js-project-with-express\/#Wrapping_up\" >Wrapping up<\/a><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n\n<p>TypeScript has been catching up the heat since its innovation as is often seen as a subset of JavaScript. If you have the basic knowledge of TypeScript, Node.js and Express, then this blog is highly recommended to get an in-depth knowledge on how to use it.\u00a0<\/p>\n\n\n\n<p>This project can also be used as a boilerplate for <strong>Node.js Typescript<\/strong> and Express projects. Read this article to understand TypeScript in a Node.js project with express.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"What_is_TypeScript\"><\/span><strong>What is TypeScript?<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh3.googleusercontent.com\/e2YDDsM-eFq_pUnnKsT-jjeGRIT6wj44OetA2jidmvHivwq1iVN66aNKHuUAYFPhgSyzvprTDG_4B5yjH622W9kNo-yeC5Gw1j34gqdkL4KrI7xWS5MxAQxa7huH7SdpYDQLInyp\" alt=\"nodejs typescript express javascript\"\/><\/figure>\n\n\n\n<p>TypeScript is an open-source language developed by Microsoft which is built on JavaScript, one of the world\u2019s most used tools, by adding static type definitions. It\u2019s listed as one of the five most promising languages in 2020.\u00a0<\/p>\n\n\n\n<p>Basically, TypeScript is a superset of JavaScript that can do what JavaScript can do along with certain additional capabilities.<\/p>\n\n\n\n<p>However, users generally struggle with using TypeScript in node.js and this is where the article takes a lead to simplify the process for you. Refer to the steps mentioned below to know how to use TypeScript in a node.js project with express-<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"1_Setting_up_our_project\"><\/span><strong>1. Setting up our project<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>The first step involves creating a directory for the project and then working with it. Run the following commands or create a folder directly on your device to create a directory called <strong>ts-nodejs <\/strong>, and then change to the current directory that we have created:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>mkdir ts-nodejs\ncd ts-nodejs<\/code><\/pre>\n\n\n\n<p>From the ts-nodejs directory, we can initialize our Node.js project. To do so, use the following command in your terminal window:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>npm init -y<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"2_Add_the_required_dependencies\"><\/span><strong>2. Add the required dependencies<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Now, TypeScript and the Express framework will be needed. Run the following commands to add them-<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>npm install express\nnpm install typescript ts-node @types\/node @types\/express --save-dev<\/code><\/pre>\n\n\n\n<p>TypeScript-related dependencies are installed as \u2018devDependencies\u2019 in the project folder. This happens because the TypeScript code that we have written eventually gets compiled into \u2018vanilla javascript\u2019. TypeScript is not exactly required for runtime thus it is only used during development.\u00a0<\/p>\n\n\n\n<p>Furthermore, \u2018package.json\u2019 should appear as following after completing the dependency installations of Node Modules:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh6.googleusercontent.com\/PzZmO_SXGyBwXFpCd6pFIxYlAMuDUKHH4olxAZR9FN0lVaQuT3yYxia9gpjXDhbGuPvY6_CYsBhKhzUWLe6koiUg7udH_mO9gqFe5jzvnCpJlQCcj34ydYAyBhFJ3Y7TvUIEiY6i\" alt=\"nodejs typescript express javascript\"\/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"3_Configuring_TypeScript_as_per_our_requirement\"><\/span><strong>3. Configuring TypeScript as per our requirement:<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Next step involves configuring TypeScript in a manner so that it can be managed directly. We need to create a file by the name of tsconfig.json, so that\u00a0 a directory for the root of a TypeScript project can be created. We can use the command given below for the same:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>npx tsc --init<\/code><\/pre>\n\n\n\n<p>If we run the command given above the tsconfig.json file will be created. We can alter the TypeScript configuration from here.<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>target<\/strong>: we can specify which ECMAScript version we want to use in our project using this option.<\/li><li><strong>module<\/strong>: we can specify which module manager has to be used in the generated JavaScript code using this option.<\/li><li><strong>outDir<\/strong>: using this option, we can specify where we can output the JavaScript code.<\/li><li><strong>rootDir<\/strong>: This option specifies where the TypeScript files are located in the directory.<\/li><li><strong>strict<\/strong>: It is enabled by default and this toggles strict type-checking options.<\/li><\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"4_Create_an_Express_server\"><\/span><strong>4. Create an Express server<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh4.googleusercontent.com\/o8c4u-OjNpspwlgzYAr7x7tGvVSE52c-jLbzMRoqwsIHNdV0Bsm1Dap2OIj1ptXnTn5W8titniht2aEWOnuzbrRSRoJa4Z_ZtrfgecE3u3RmaX46uSN0JRD7X06BZHiPDI3ozpjM\" alt=\"nodejs typescript express javascript\"\/><\/figure>\n\n\n\n<p>After completing TypeScript code configuration, you can move to create Express Web Server. First create index.ts file with the code given below:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import express from 'express';\n\nconst app = express();\n\napp.get('\/', (req, res) => {\n    res.send('Hello World!!');\n})\n\napp.listen(3200, () => {\n    console.log('The application is listening on port 3200!');\n})\n<\/code><\/pre>\n\n\n\n<p>It creates a web server that shows \u201cHello World!!\u201d after running the project with localhost:3200 in any browser.<\/p>\n\n\n\n<p>Whenever we make some changes in our code and then we want to run the application, we will need to compile TypeScript to JavaScript. To do that, we can :<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>npx tsc --project .\/<\/code><\/pre>\n\n\n\n<p>The command \u2018tsc\u2019 compiles the TypeScript to JavaScript. The flag \u2018\u2013project\u2019 specifies where to pick up the stored TypeScript files and \u201c.\/\u201d tells about the root of the project.<\/p>\n\n\n\n<p>Now if we access the build folder in the ts-nodejs directory, we can see the compiled JavaScript code.\u00a0<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"5_Accessing_the_Created_scripts\"><\/span><strong>5. Accessing the Created scripts<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>It can be a typical task to manually write npx tsc \u2013project .\/ every time we need to compile the code. To automate the process, add a script to package.json\u00a0<\/p>\n\n\n\n<p>Achieve this by modifying the line of codes in package.json under scripts:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\"build\": \"tsc --project .\/\"<\/code><\/pre>\n\n\n\n<p>Now you can run:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>npm run build <\/code><\/pre>\n\n\n\n<p>to compile the code.\u00a0<\/p>\n\n\n\n<p>To run the project use<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>node index.js<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh3.googleusercontent.com\/xASkhaOdwRTNZisRgP1OG5oPda1FsuOFKE_RAHQAiwqY3v4MJu6vuBegK6jNmTAt_lg0W6dJ5htrHwA8mSq_S5wna71k9zCBQpCT3JVOugLieL35L7ETgGOO0QOEM5iuXG7Z6Acn\" alt=\"nodejs typescript express javascript\"\/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Wrapping_up\"><\/span><strong>Wrapping up<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Hope this article has provided you with clarity on <strong>TypeScript Tutorial<\/strong>. But if you still find any phase challenging, we suggest you <strong>Hire the Best TypeScript Development Company<\/strong> in the market.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This blog helps in understanding and creating a boilerplate for Node.js Typescript and Express projects. <\/p>\n","protected":false},"author":1,"featured_media":5989,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[40],"tags":[52,51,55,53],"class_list":["post-5824","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-web-development","tag-express","tag-nodejs","tag-nodejs-with-typescript","tag-typescript"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.2 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Nlineaxis IT Solutions Private Limited in USA<\/title>\n<meta name=\"description\" content=\"This article will teach you about nodejs typescript express javascript. Visit our website to learn more about typescript.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/nlineaxis.com\/blog\/how-to-work-with-typescript-in-a-node-js-project-with-express\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Nlineaxis IT Solutions Private Limited in USA\" \/>\n<meta property=\"og:description\" content=\"This article will teach you about nodejs typescript express javascript. Visit our website to learn more about typescript.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/nlineaxis.com\/blog\/how-to-work-with-typescript-in-a-node-js-project-with-express\/\" \/>\n<meta property=\"og:site_name\" content=\"Nlineaxis IT Solutions Private Limited in USA\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/Kapilsalesforce\" \/>\n<meta property=\"article:published_time\" content=\"2021-05-31T13:01:10+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-09-14T12:41:30+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/nlineaxis.com\/blog\/wp-content\/uploads\/2021\/05\/Typescript-in-node.js-project.png\" \/>\n\t<meta property=\"og:image:width\" content=\"2240\" \/>\n\t<meta property=\"og:image:height\" content=\"1260\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@NLINEAXIS\" \/>\n<meta name=\"twitter:site\" content=\"@NLINEAXIS\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/nlineaxis.com\/blog\/how-to-work-with-typescript-in-a-node-js-project-with-express\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/nlineaxis.com\/blog\/how-to-work-with-typescript-in-a-node-js-project-with-express\/\"},\"author\":{\"name\":\"admin\",\"@id\":\"https:\/\/nlineaxis.com\/blog\/#\/schema\/person\/d5f9a5789fb3a97c19604c0252086f48\"},\"headline\":\"How to work with TypeScript in a Node.js Project with Express\",\"datePublished\":\"2021-05-31T13:01:10+00:00\",\"dateModified\":\"2021-09-14T12:41:30+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/nlineaxis.com\/blog\/how-to-work-with-typescript-in-a-node-js-project-with-express\/\"},\"wordCount\":711,\"commentCount\":1,\"image\":{\"@id\":\"https:\/\/nlineaxis.com\/blog\/how-to-work-with-typescript-in-a-node-js-project-with-express\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/nlineaxis.com\/blog\/wp-content\/uploads\/2021\/05\/Typescript-in-node.js-project.png\",\"keywords\":[\"express\",\"nodejs\",\"nodejs with typescript\",\"typescript\"],\"articleSection\":[\"Web Development\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/nlineaxis.com\/blog\/how-to-work-with-typescript-in-a-node-js-project-with-express\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/nlineaxis.com\/blog\/how-to-work-with-typescript-in-a-node-js-project-with-express\/\",\"url\":\"https:\/\/nlineaxis.com\/blog\/how-to-work-with-typescript-in-a-node-js-project-with-express\/\",\"name\":\"Nlineaxis IT Solutions Private Limited in USA\",\"isPartOf\":{\"@id\":\"https:\/\/nlineaxis.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/nlineaxis.com\/blog\/how-to-work-with-typescript-in-a-node-js-project-with-express\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/nlineaxis.com\/blog\/how-to-work-with-typescript-in-a-node-js-project-with-express\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/nlineaxis.com\/blog\/wp-content\/uploads\/2021\/05\/Typescript-in-node.js-project.png\",\"datePublished\":\"2021-05-31T13:01:10+00:00\",\"dateModified\":\"2021-09-14T12:41:30+00:00\",\"author\":{\"@id\":\"https:\/\/nlineaxis.com\/blog\/#\/schema\/person\/d5f9a5789fb3a97c19604c0252086f48\"},\"description\":\"This article will teach you about nodejs typescript express javascript. Visit our website to learn more about typescript.\",\"breadcrumb\":{\"@id\":\"https:\/\/nlineaxis.com\/blog\/how-to-work-with-typescript-in-a-node-js-project-with-express\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/nlineaxis.com\/blog\/how-to-work-with-typescript-in-a-node-js-project-with-express\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/nlineaxis.com\/blog\/how-to-work-with-typescript-in-a-node-js-project-with-express\/#primaryimage\",\"url\":\"https:\/\/nlineaxis.com\/blog\/wp-content\/uploads\/2021\/05\/Typescript-in-node.js-project.png\",\"contentUrl\":\"https:\/\/nlineaxis.com\/blog\/wp-content\/uploads\/2021\/05\/Typescript-in-node.js-project.png\",\"width\":2240,\"height\":1260,\"caption\":\"Typescript in node.js project\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/nlineaxis.com\/blog\/how-to-work-with-typescript-in-a-node-js-project-with-express\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/nlineaxis.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to work with TypeScript in a Node.js Project with Express\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/nlineaxis.com\/blog\/#website\",\"url\":\"https:\/\/nlineaxis.com\/blog\/\",\"name\":\"Nlineaxis IT Solutions Private Limited in USA\",\"description\":\"Innovating business solutions\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/nlineaxis.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/nlineaxis.com\/blog\/#\/schema\/person\/d5f9a5789fb3a97c19604c0252086f48\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/secure.gravatar.com\/avatar\/a51b5aa28a1e28c9b84e3f591ad42ec55b78763489101043e3ffa790afb54ab0?s=96&d=mm&r=g\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/a51b5aa28a1e28c9b84e3f591ad42ec55b78763489101043e3ffa790afb54ab0?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/a51b5aa28a1e28c9b84e3f591ad42ec55b78763489101043e3ffa790afb54ab0?s=96&d=mm&r=g\",\"caption\":\"admin\"},\"sameAs\":[\"https:\/\/nlineaxis.com\/blog\/\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Nlineaxis IT Solutions Private Limited in USA","description":"This article will teach you about nodejs typescript express javascript. Visit our website to learn more about typescript.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/nlineaxis.com\/blog\/how-to-work-with-typescript-in-a-node-js-project-with-express\/","og_locale":"en_US","og_type":"article","og_title":"Nlineaxis IT Solutions Private Limited in USA","og_description":"This article will teach you about nodejs typescript express javascript. Visit our website to learn more about typescript.","og_url":"https:\/\/nlineaxis.com\/blog\/how-to-work-with-typescript-in-a-node-js-project-with-express\/","og_site_name":"Nlineaxis IT Solutions Private Limited in USA","article_publisher":"https:\/\/www.facebook.com\/Kapilsalesforce","article_published_time":"2021-05-31T13:01:10+00:00","article_modified_time":"2021-09-14T12:41:30+00:00","og_image":[{"width":2240,"height":1260,"url":"https:\/\/nlineaxis.com\/blog\/wp-content\/uploads\/2021\/05\/Typescript-in-node.js-project.png","type":"image\/png"}],"author":"admin","twitter_card":"summary_large_image","twitter_creator":"@NLINEAXIS","twitter_site":"@NLINEAXIS","twitter_misc":{"Written by":"admin","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/nlineaxis.com\/blog\/how-to-work-with-typescript-in-a-node-js-project-with-express\/#article","isPartOf":{"@id":"https:\/\/nlineaxis.com\/blog\/how-to-work-with-typescript-in-a-node-js-project-with-express\/"},"author":{"name":"admin","@id":"https:\/\/nlineaxis.com\/blog\/#\/schema\/person\/d5f9a5789fb3a97c19604c0252086f48"},"headline":"How to work with TypeScript in a Node.js Project with Express","datePublished":"2021-05-31T13:01:10+00:00","dateModified":"2021-09-14T12:41:30+00:00","mainEntityOfPage":{"@id":"https:\/\/nlineaxis.com\/blog\/how-to-work-with-typescript-in-a-node-js-project-with-express\/"},"wordCount":711,"commentCount":1,"image":{"@id":"https:\/\/nlineaxis.com\/blog\/how-to-work-with-typescript-in-a-node-js-project-with-express\/#primaryimage"},"thumbnailUrl":"https:\/\/nlineaxis.com\/blog\/wp-content\/uploads\/2021\/05\/Typescript-in-node.js-project.png","keywords":["express","nodejs","nodejs with typescript","typescript"],"articleSection":["Web Development"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/nlineaxis.com\/blog\/how-to-work-with-typescript-in-a-node-js-project-with-express\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/nlineaxis.com\/blog\/how-to-work-with-typescript-in-a-node-js-project-with-express\/","url":"https:\/\/nlineaxis.com\/blog\/how-to-work-with-typescript-in-a-node-js-project-with-express\/","name":"Nlineaxis IT Solutions Private Limited in USA","isPartOf":{"@id":"https:\/\/nlineaxis.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/nlineaxis.com\/blog\/how-to-work-with-typescript-in-a-node-js-project-with-express\/#primaryimage"},"image":{"@id":"https:\/\/nlineaxis.com\/blog\/how-to-work-with-typescript-in-a-node-js-project-with-express\/#primaryimage"},"thumbnailUrl":"https:\/\/nlineaxis.com\/blog\/wp-content\/uploads\/2021\/05\/Typescript-in-node.js-project.png","datePublished":"2021-05-31T13:01:10+00:00","dateModified":"2021-09-14T12:41:30+00:00","author":{"@id":"https:\/\/nlineaxis.com\/blog\/#\/schema\/person\/d5f9a5789fb3a97c19604c0252086f48"},"description":"This article will teach you about nodejs typescript express javascript. Visit our website to learn more about typescript.","breadcrumb":{"@id":"https:\/\/nlineaxis.com\/blog\/how-to-work-with-typescript-in-a-node-js-project-with-express\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/nlineaxis.com\/blog\/how-to-work-with-typescript-in-a-node-js-project-with-express\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/nlineaxis.com\/blog\/how-to-work-with-typescript-in-a-node-js-project-with-express\/#primaryimage","url":"https:\/\/nlineaxis.com\/blog\/wp-content\/uploads\/2021\/05\/Typescript-in-node.js-project.png","contentUrl":"https:\/\/nlineaxis.com\/blog\/wp-content\/uploads\/2021\/05\/Typescript-in-node.js-project.png","width":2240,"height":1260,"caption":"Typescript in node.js project"},{"@type":"BreadcrumbList","@id":"https:\/\/nlineaxis.com\/blog\/how-to-work-with-typescript-in-a-node-js-project-with-express\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/nlineaxis.com\/blog\/"},{"@type":"ListItem","position":2,"name":"How to work with TypeScript in a Node.js Project with Express"}]},{"@type":"WebSite","@id":"https:\/\/nlineaxis.com\/blog\/#website","url":"https:\/\/nlineaxis.com\/blog\/","name":"Nlineaxis IT Solutions Private Limited in USA","description":"Innovating business solutions","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/nlineaxis.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/nlineaxis.com\/blog\/#\/schema\/person\/d5f9a5789fb3a97c19604c0252086f48","name":"admin","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/a51b5aa28a1e28c9b84e3f591ad42ec55b78763489101043e3ffa790afb54ab0?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/a51b5aa28a1e28c9b84e3f591ad42ec55b78763489101043e3ffa790afb54ab0?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/a51b5aa28a1e28c9b84e3f591ad42ec55b78763489101043e3ffa790afb54ab0?s=96&d=mm&r=g","caption":"admin"},"sameAs":["https:\/\/nlineaxis.com\/blog\/"]}]}},"_links":{"self":[{"href":"https:\/\/nlineaxis.com\/blog\/wp-json\/wp\/v2\/posts\/5824","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nlineaxis.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nlineaxis.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nlineaxis.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/nlineaxis.com\/blog\/wp-json\/wp\/v2\/comments?post=5824"}],"version-history":[{"count":3,"href":"https:\/\/nlineaxis.com\/blog\/wp-json\/wp\/v2\/posts\/5824\/revisions"}],"predecessor-version":[{"id":6018,"href":"https:\/\/nlineaxis.com\/blog\/wp-json\/wp\/v2\/posts\/5824\/revisions\/6018"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/nlineaxis.com\/blog\/wp-json\/wp\/v2\/media\/5989"}],"wp:attachment":[{"href":"https:\/\/nlineaxis.com\/blog\/wp-json\/wp\/v2\/media?parent=5824"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nlineaxis.com\/blog\/wp-json\/wp\/v2\/categories?post=5824"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nlineaxis.com\/blog\/wp-json\/wp\/v2\/tags?post=5824"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}