{"componentChunkName":"component---src-templates-tag-js","path":"/tags/hello-world/","result":{"data":{"site":{"siteMetadata":{"title":"LoginRadius Blog"}},"allMarkdownRemark":{"totalCount":1,"edges":[{"node":{"fields":{"slug":"/engineering/hello-world-deno/"},"html":"<h3 id=\"hello-deno\" style=\"position:relative;\"><a href=\"#hello-deno\" aria-label=\"hello deno permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Hello, Deno</h3>\n<p>Deno is a new platform for writing applications using JavaScript and TypeScript. It is based on the V8 JavaScript engine and the Rust.</p>\n<p>Deno’s lowest level binding layer to the system is tied to promises (called <strong>ops</strong>). Deno is secure by default, provides first-class TypeScript support, has built-in utilities like a dependency inspector, and supports third-party modules such as <strong>lodash</strong> .</p>\n<p>Btw, this is the best damn geeky one-liner code to explain what is Deno. Totally cool.</p>\n<p><img src=\"/3dccb354c5a6bfd002b925289a8fb026/twitter.webp\" alt=\"alt_text\" title=\"Twitter\"></p>\n<h3 id=\"installation\" style=\"position:relative;\"><a href=\"#installation\" aria-label=\"installation permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Installation</h3>\n<p>Deno works on macOS, Linux, and Windows. Deno is a single binary executable and it has no external dependencies.</p>\n<p>See all <a href=\"https://docs.deno.com/runtime/getting_started/installation/\">installation</a>.</p>\n<h4 id=\"install-deno-on-windows-1087\" style=\"position:relative;\"><a href=\"#install-deno-on-windows-1087\" aria-label=\"install deno on windows 1087 permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><strong>Install Deno on Windows 10/8/7</strong></h4>\n<p>Launch <strong>Windows PowerShell</strong> and run the following command to install Deno on <strong>Windows 10/8/7</strong></p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"\" data-index=\"0\"><code class=\"grvsc-code\"><span class=\"grvsc-line\">iwr https://deno.land/x/install/install.ps1 -useb | iex</span></code></pre>\n<h4 id=\"install-deno-on-linux-and-macos\" style=\"position:relative;\"><a href=\"#install-deno-on-linux-and-macos\" aria-label=\"install deno on linux and macos permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><strong>Install Deno on Linux and macOS</strong></h4>\n<p>Launch terminal and run the following command to install Deno on Linux and Mac</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"\" data-index=\"1\"><code class=\"grvsc-code\"><span class=\"grvsc-line\">curl -fsSL https://deno.land/x/install/install.sh | sh</span></code></pre>\n<p>Open a new terminal and run <code>deno</code>. You should get a <code>></code> prompt. Type <code>exit</code>.</p>\n<p>After installing deno on your system we just need to create a simple <strong>Hello World</strong> program by using the following steps :</p>\n<p>Step 1. Create a Folder as per your project name by using command prompt</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"\" data-index=\"2\"><code class=\"grvsc-code\"><span class=\"grvsc-line\">mkdir HelloWorldDeno</span></code></pre>\n<p>Step 2. Create a typeScript file and name it <strong>index.ts.</strong></p>\n<p>Step 3. Add the following code in <strong>index.ts.</strong></p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"ts\" data-index=\"3\"><code class=\"grvsc-code\"><span class=\"grvsc-line\"><span class=\"mtk4\">const</span><span class=\"mtk1\"> </span><span class=\"mtk11\">helloWorld</span><span class=\"mtk1\"> = (</span><span class=\"mtk12\">name</span><span class=\"mtk1\">: </span><span class=\"mtk10\">string</span><span class=\"mtk1\"> = </span><span class=\"mtk8\">&quot;world&quot;</span><span class=\"mtk1\">) </span><span class=\"mtk4\">=&gt;</span><span class=\"mtk1\"> {</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">  </span><span class=\"mtk10\">console</span><span class=\"mtk1\">.</span><span class=\"mtk11\">log</span><span class=\"mtk1\">(</span><span class=\"mtk8\">`Hello </span><span class=\"mtk4\">${</span><span class=\"mtk12\">name</span><span class=\"mtk4\">}</span><span class=\"mtk8\">!!`</span><span class=\"mtk1\">);</span></span>\n<span class=\"grvsc-line\"><span class=\"mtk1\">}</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk11\">helloWorld</span><span class=\"mtk1\">();</span></span>\n<span class=\"grvsc-line\"></span>\n<span class=\"grvsc-line\"><span class=\"mtk11\">helloWorld</span><span class=\"mtk1\">(</span><span class=\"mtk8\">&quot;Friend&quot;</span><span class=\"mtk1\">);</span></span></code></pre>\n<p>Step 4. Run the following project by using the following command</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"\" data-index=\"4\"><code class=\"grvsc-code\"><span class=\"grvsc-line\">deno run index.ts</span></code></pre>\n<p>You can check the result here</p>\n<p><img src=\"/c9187b83647bac95a00b0dc259f75826/cmd.webp\" alt=\"alt_text\" title=\"Result\"></p>\n<p>Yupppp it works this is your first Deno program !!</p>\n<style class=\"grvsc-styles\">\n  .grvsc-container {\n    overflow: auto;\n    -webkit-overflow-scrolling: touch;\n    padding-top: 1rem;\n    padding-top: var(--grvsc-padding-top, var(--grvsc-padding-v, 1rem));\n    padding-bottom: 1rem;\n    padding-bottom: var(--grvsc-padding-bottom, var(--grvsc-padding-v, 1rem));\n    border-radius: 8px;\n    border-radius: var(--grvsc-border-radius, 8px);\n    font-feature-settings: normal;\n  }\n  \n  .grvsc-code {\n    display: inline-block;\n    min-width: 100%;\n  }\n  \n  .grvsc-line {\n    display: inline-block;\n    box-sizing: border-box;\n    width: 100%;\n    padding-left: 1.5rem;\n    padding-left: var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem));\n    padding-right: 1.5rem;\n    padding-right: var(--grvsc-padding-right, var(--grvsc-padding-h, 1.5rem));\n  }\n  \n  .grvsc-line-highlighted {\n    background-color: var(--grvsc-line-highlighted-background-color, transparent);\n    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, transparent);\n  }\n  \n  .dark-default-dark {\n    background-color: #1E1E1E;\n    color: #D4D4D4;\n  }\n  .dark-default-dark .mtk4 { color: #569CD6; }\n  .dark-default-dark .mtk1 { color: #D4D4D4; }\n  .dark-default-dark .mtk11 { color: #DCDCAA; }\n  .dark-default-dark .mtk12 { color: #9CDCFE; }\n  .dark-default-dark .mtk10 { color: #4EC9B0; }\n  .dark-default-dark .mtk8 { color: #CE9178; }\n</style>","frontmatter":{"date":"June 02, 2020","updated_date":null,"title":"Hello world with Deno","tags":["Deno","HelloWorld","NodeJs"],"coverImage":{"childImageSharp":{"fluid":{"aspectRatio":1.7699115044247788,"src":"/static/70351d960fd94ea6641dc19419a97bbc/58556/deno.webp","srcSet":"/static/70351d960fd94ea6641dc19419a97bbc/61e93/deno.webp 200w,\n/static/70351d960fd94ea6641dc19419a97bbc/1f5c5/deno.webp 400w,\n/static/70351d960fd94ea6641dc19419a97bbc/58556/deno.webp 800w,\n/static/70351d960fd94ea6641dc19419a97bbc/99238/deno.webp 1200w,\n/static/70351d960fd94ea6641dc19419a97bbc/135cd/deno.webp 1280w","sizes":"(max-width: 800px) 100vw, 800px"}}},"author":{"id":"Ashish Sharma","github":"ashish8947","avatar":null}}}}]}},"pageContext":{"tag":"HelloWorld"}},"staticQueryHashes":["1171199041","1384082988","2100481360","23180105","528864852"]}