<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Alberto Beiz</title>
    <description>The latest articles on DEV Community by Alberto Beiz (@albertobeiz).</description>
    <link>https://dev.to/albertobeiz</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F151321%2F29bdb8ef-91c0-4fc1-9bc4-30f137599d89.jpeg</url>
      <title>DEV Community: Alberto Beiz</title>
      <link>https://dev.to/albertobeiz</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/albertobeiz"/>
    <language>en</language>
    <item>
      <title>Exploring Denoland #1 - My first stomps with DENO</title>
      <dc:creator>Alberto Beiz</dc:creator>
      <pubDate>Fri, 15 May 2020 16:35:32 +0000</pubDate>
      <link>https://dev.to/albertobeiz/exploring-denoland-1-my-first-stomps-with-deno-ggl</link>
      <guid>https://dev.to/albertobeiz/exploring-denoland-1-my-first-stomps-with-deno-ggl</guid>
      <description>&lt;p&gt;Sooo Deno 1.0 just launched. I have 0 knowledge about it but I’m curious to see what it has to offer. &lt;/p&gt;

&lt;p&gt;As the seasoned software developer that I am, let’s start as usual:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--wjR_u-6s--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/d62sex3q65q98qab1o9x.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--wjR_u-6s--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/d62sex3q65q98qab1o9x.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Deno.land looks promising, let’s execute the installation command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-fsSL&lt;/span&gt; https://deno.land/x/install/install.sh | sh
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;





&lt;div class="highlight"&gt;&lt;pre class="highlight shell"&gt;&lt;code&gt;Deno was installed successfully
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;That was fast and easy. After adding needed variables to my .bash_profile I can see my deno version:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;deno &lt;span class="nt"&gt;--version&lt;/span&gt;
deno 1.0.0
v8 8.4.300
typescript 3.9.2
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Soooooo let’s try it...wait...I...can...execute...remote...scripts...just...like...this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;deno run https://deno.land/std/examples/welcome.ts
Welcome to Deno 🦕
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;That’s useful...and scary...but they say it’s secure so ¯_(ツ)_/¯&lt;/p&gt;

&lt;p&gt;Ok last test in deno.land is the classic web server. I create a new test.ts file, copy the code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;serve&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;https://deno.land/std@0.50.0/http/server.ts&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;s&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;serve&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;port&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;8000&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;http://localhost:8000/&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;req&lt;/span&gt; &lt;span class="k"&gt;of&lt;/span&gt; &lt;span class="nx"&gt;s&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
 &lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;respond&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;body&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Hello World&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;and run &lt;code&gt;$ deno test.ts&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;ERROR...It’s &lt;code&gt;$ deno run test.ts&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight shell"&gt;&lt;code&gt;ERROR Uncaught PermissionDenied: network access to &lt;span class="s2"&gt;"0.0.0.0:8000"&lt;/span&gt;, 
run again with the &lt;span class="nt"&gt;--allow-net&lt;/span&gt; flag
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Here is the security, I have to explicitly allow Deno access to network requests:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;deno run test.ts &lt;span class="nt"&gt;--allow-net&lt;/span&gt; 
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;ERROR...what about...&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;deno run &lt;span class="nt"&gt;--allow-net&lt;/span&gt; test.ts 
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;SUCCESS --- &lt;strong&gt;Hello Denoland&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  End of exploration #1
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Native Typescript support 💙💙💙💙&lt;/li&gt;
&lt;li&gt;I like the idea of a strong and controlled standard library.&lt;/li&gt;
&lt;li&gt;No package.json, fixed urls for packages. What about updating?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Have you tried Deno? Any thoughts about it?&lt;/p&gt;

&lt;p&gt;&lt;a href="https://twitter/albertobeiz"&gt;@albertobeiz&lt;/a&gt;&lt;/p&gt;

</description>
      <category>deno</category>
    </item>
  </channel>
</rss>
