{"componentChunkName":"component---src-pages-markdown-remark-fields-slug-js","path":"/engineering/hello-world-deno/","result":{"data":{"markdownRemark":{"id":"da3b08e6-4fe0-5300-9bed-84454de297ef","excerpt":"Hello, Deno Deno is a new platform for writing applications using JavaScript and TypeScript. It is based on the V8 JavaScript engine and the Rust. Deno’s lowest…","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><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 597px; \"\n    >\n      <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 24.623115577889447%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAFCAYAAABFA8wzAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAwUlEQVQY041QuQ6CQBTk3+n5Lmw02mGjJmpALFj2Psd9qxijjdPM9TLZbMU9Crpuj/VmA+dc8Skl/IvllrhiM4dUCkJKcC4QYkTMBZUxpuLTy5fsQ3/nMd9WdV2jaRqcLxccjidc+wH9bcQw3tEPI7Q2Py8muQwtHY2FkAdXbYvdbgtjDBhjkFLAWoNpYsV7799DIYTnl7zHUxn5REUVRbPUkNrCOA/rQ9GUCWWgrYM2DrNQmLjM3TMjZjkjrXJP/ADZdIQN2Y9dHAAAAABJRU5ErkJggg=='); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"alt_text\"\n        title=\"Twitter\"\n        src=\"/static/ab0017058c6f2515d379f3532daea705/17602/twitter.png\"\n        srcset=\"/static/ab0017058c6f2515d379f3532daea705/17602/twitter.png 597w\"\n        sizes=\"(max-width: 597px) 100vw, 597px\"\n        style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n        loading=\"lazy\"\n      />\n    </span></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><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 768px; \"\n    >\n      <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 29.69230769230769%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAGCAYAAADDl76dAAAACXBIWXMAAA7DAAAOwwHHb6hkAAAApUlEQVQY08WOQQqDMBBFh6jJhGDBIpQewwMIHqx4CQUXLoxewQN+M1Pqpou66+LxJoR5DPWvHuM4YhgG9TzP2LYN67oqMb69LIsSYzz9Qd7TNGHfd1D5LBFuAZ49rLUn7Jy6KAo1Ef2kaRpQ/ahR3SuEEGBdCjGDvYdPSCzPc0XmLMtgjPlC/iTYdR2IHeuCSxdpLCGzBCVw5TKJitu2BV1d+lvwAH8sotK/L3xwAAAAAElFTkSuQmCC'); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"alt_text\"\n        title=\"Result\"\n        src=\"/static/52358765209f0df27b81040673360e7d/e5715/cmd.png\"\n        srcset=\"/static/52358765209f0df27b81040673360e7d/a6d36/cmd.png 650w,\n/static/52358765209f0df27b81040673360e7d/e5715/cmd.png 768w,\n/static/52358765209f0df27b81040673360e7d/23725/cmd.png 1105w\"\n        sizes=\"(max-width: 768px) 100vw, 768px\"\n        style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n        loading=\"lazy\"\n      />\n    </span></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>","headings":[{"value":"Hello, Deno","depth":3},{"value":"Installation","depth":3},{"value":"Install Deno on Windows 10/8/7","depth":4},{"value":"Install Deno on Linux and macOS","depth":4}],"fields":{"slug":"/engineering/hello-world-deno/"},"frontmatter":{"metatitle":null,"metadescription":null,"description":null,"title":"Hello world with Deno","canonical":null,"date":"June 02, 2020","updated_date":null,"tags":["Deno","HelloWorld","NodeJs"],"coverImage":{"childImageSharp":{"fluid":{"aspectRatio":1.7699115044247788,"src":"/static/9e27529ebed74724b5d86438b9445e49/03979/deno.png","srcSet":"/static/9e27529ebed74724b5d86438b9445e49/f5f11/deno.png 200w,\n/static/9e27529ebed74724b5d86438b9445e49/6d133/deno.png 400w,\n/static/9e27529ebed74724b5d86438b9445e49/03979/deno.png 800w,\n/static/9e27529ebed74724b5d86438b9445e49/aca38/deno.png 1200w,\n/static/9e27529ebed74724b5d86438b9445e49/7952d/deno.png 1280w","sizes":"(max-width: 800px) 100vw, 800px"}}},"author":{"id":"Ashish Sharma","github":"ashish8947","bio":"Ashish is a software engineer who continually seeks clean, elegant solutions to business challenges. His lifelong passion for technology drives him to proactively expand horizons, constantly exploring and evaluating new languages, platforms, frameworks and tools.","avatar":null}}}},"pageContext":{"id":"da3b08e6-4fe0-5300-9bed-84454de297ef","fields__slug":"/engineering/hello-world-deno/","__params":{"fields__slug":"engineering"}}},"staticQueryHashes":["1171199041","1384082988","1711371485","1753898100","2100481360","229320306","23180105","528864852"]}