<?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>Forem: Vicky Gonsalves</title>
    <description>The latest articles on Forem by Vicky Gonsalves (@vickygonsalves).</description>
    <link>https://forem.com/vickygonsalves</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%2F1112980%2F724dc7c8-30a2-4d60-8f2a-89b414dcac24.jpeg</url>
      <title>Forem: Vicky Gonsalves</title>
      <link>https://forem.com/vickygonsalves</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/vickygonsalves"/>
    <language>en</language>
    <item>
      <title>Why We Should Start Using Deno: A Comprehensive Guide</title>
      <dc:creator>Vicky Gonsalves</dc:creator>
      <pubDate>Tue, 04 Jul 2023 05:26:21 +0000</pubDate>
      <link>https://forem.com/vickygonsalves/why-we-should-start-using-deno-a-comprehensive-guide-33bk</link>
      <guid>https://forem.com/vickygonsalves/why-we-should-start-using-deno-a-comprehensive-guide-33bk</guid>
      <description>&lt;p&gt;In the ever-evolving world of JavaScript, a new contender has emerged that's turning heads in the developer community. Meet Deno, a secure runtime for JavaScript, TypeScript, and WebAssembly. But what makes Deno stand out in the crowded JavaScript landscape? Let's dive deep into the compelling reasons.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Secure by Default: A New Standard in JavaScript Runtimes
&lt;/h2&gt;

&lt;p&gt;In today's digital world, security is no longer optional. Deno takes this to heart by being secure by default. Unlike Node.js, where scripts have unrestricted access to the file system, environment variables, and network, Deno restricts these capabilities. This feature alone sets a new standard for security in JavaScript runtimes.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Embracing TypeScript: No More Transpilation Hassles
&lt;/h2&gt;

&lt;p&gt;TypeScript, a statically typed superset of JavaScript, has gained significant popularity for its ability to catch errors during development. Deno offers first-class TypeScript support out of the box, eliminating the need for a separate transpilation step as in Node.js. If you're a TypeScript enthusiast, this feature alone might be a reason to switch.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Standard Library: Quality Code at Your Fingertips
&lt;/h2&gt;

&lt;p&gt;One of the challenges with Node.js is the lack of a standard library. Deno addresses this by providing a set of reviewed (audited) standard modules that are guaranteed to work with Deno. These modules cover a wide range of functionalities, improving the quality of your code and saving you time.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Built-in Tooling: Streamlining Your Development Workflow
&lt;/h2&gt;

&lt;p&gt;Deno comes with a suite of built-in tools, including a test runner, a code formatter, and a linter. This eliminates the need for external tooling and makes your setup process much simpler and more efficient. These tools are designed to work seamlessly with Deno, reducing the friction often experienced when setting up development environments.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. ES Modules: Embracing Modern JavaScript
&lt;/h2&gt;

&lt;p&gt;Deno uses ES modules as its default module system. This is a more modern and standardized approach compared to Node.js's CommonJS module system. ES modules are statically analyzable, which means tools can take advantage of this to provide better code optimization and refactoring capabilities.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. Browser Compatibility: Write Once, Run Anywhere
&lt;/h2&gt;

&lt;p&gt;Deno aims to be compatible with the web browser APIs. This means you can write code that runs both on the server and in the browser without having to worry about compatibility issues. This is a significant advantage for developers who work on full-stack applications and want to share code between the server and the client.&lt;/p&gt;

&lt;h2&gt;
  
  
  7. Simplified Dependency Management: No More node_modules
&lt;/h2&gt;

&lt;p&gt;In Deno, there's no package.json or node_modules directory. Dependencies are imported via URLs and cached locally. This can lead to a more straightforward and manageable dependency graph. It also eliminates the "download the internet" problem often associated with Node.js projects.&lt;/p&gt;

&lt;h2&gt;
  
  
  8. Continuous Development: A Future-Proof Runtime
&lt;/h2&gt;

&lt;p&gt;Deno is under active development with a growing community. As of the latest version (v1.34.3), new features and improvements are being added regularly. The team behind Deno is committed to making it a robust and reliable runtime for JavaScript and TypeScript.&lt;/p&gt;

&lt;h2&gt;
  
  
  9. Compatibility with NPM Packages: Best of Both Worlds
&lt;/h2&gt;

&lt;p&gt;While Deno has its own module system, it also provides compatibility with existing NPM packages. This is achieved through a compatibility layer that allows you to import NPM packages in your Deno applications. This compatibility with NPM packages means that you don't have to abandon your favorite NPM libraries when you switch to Deno. It's another reason why transitioning from Node.js to Deno can be smoother than you might think.&lt;/p&gt;

&lt;h2&gt;
  
  
  10. Why It's Time to Get Started with Deno
&lt;/h2&gt;

&lt;p&gt;With all these features and improvements, there's never been a better time to start using Deno. Whether you're a seasoned Node.js developer looking for a more secure and efficient runtime, or you're new to server-side JavaScript and want to start on the right foot, Deno has a lot to offer.&lt;/p&gt;

&lt;p&gt;Deno's focus on security, modern JavaScript features, and developer productivity make it a compelling choice for today's web developers. Its active development and growing community mean that it's continually improving and evolving.&lt;/p&gt;

&lt;p&gt;Moreover, the compatibility with NPM packages and the familiar JavaScript/TypeScript syntax mean that the learning curve for Node.js developers is not steep. You can leverage your existing JavaScript/TypeScript knowledge and even reuse your favorite NPM packages.&lt;/p&gt;

&lt;p&gt;In conclusion, Deno is not just a new JavaScript runtime. It's a step forward in the evolution of JavaScript and TypeScript on the server. It's a runtime that aligns with the modern web's needs and the current best practices in software development.&lt;/p&gt;

&lt;p&gt;So why wait? It's time to get started with Deno!&lt;/p&gt;

&lt;h2&gt;
  
  
  11. Getting Started with Deno
&lt;/h2&gt;

&lt;p&gt;If you're interested in trying out Deno, it's easy to get started. You can install Deno using Shell (macOS, Linux):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-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;p&gt;Or using PowerShell (Windows):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;iwr https://deno.land/x/install/install.ps1 &lt;span class="nt"&gt;-useb&lt;/span&gt; | iex
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once installed, you can check the version of Deno:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;deno &lt;span class="nt"&gt;--version&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And run a simple program:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;deno run https://deno.land/std/examples/welcome.ts
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can find more examples and tutorials in the &lt;a href="https://deno.land/manual@v1.34.3/introduction"&gt;Deno manual&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I hope you found this post helpful. If you have any questions or thoughts about Deno, feel free to leave a comment below. Let's start the conversation and learn together. Happy coding!&lt;/p&gt;

&lt;p&gt;&lt;em&gt;References:&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://deno.land/manual"&gt;Deno Manual&lt;/a&gt;&lt;br&gt;
&lt;a href="https://deno.land/api"&gt;Deno API&lt;/a&gt;&lt;br&gt;
&lt;a href="https://deno.land/std"&gt;Deno Standard Library&lt;/a&gt;&lt;br&gt;
&lt;a href="https://deno.land/x"&gt;Deno Third-Party Modules&lt;/a&gt;&lt;/p&gt;

</description>
      <category>deno</category>
      <category>javascript</category>
      <category>typescript</category>
      <category>node</category>
    </item>
    <item>
      <title>Building RESTful APIs with Deno: A Boilerplate for Rapid Development</title>
      <dc:creator>Vicky Gonsalves</dc:creator>
      <pubDate>Tue, 04 Jul 2023 04:59:09 +0000</pubDate>
      <link>https://forem.com/vickygonsalves/building-restful-apis-with-deno-a-boilerplate-for-rapid-development-4feo</link>
      <guid>https://forem.com/vickygonsalves/building-restful-apis-with-deno-a-boilerplate-for-rapid-development-4feo</guid>
      <description>&lt;p&gt;Hey, Dev.to community! Today, I'm excited to introduce you to Deno REST, a straightforward boilerplate project for building RESTful APIs using Deno, Oak, and deno_mongo. Deno is a secure runtime for JavaScript and TypeScript, Oak is a middleware framework for Deno's HTTP server, and deno_mongo is a MongoDB driver for Deno.&lt;/p&gt;

&lt;h3&gt;
  
  
  Features
&lt;/h3&gt;

&lt;p&gt;Deno REST comes packed with several useful features to help you jumpstart your API development:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Organized by Model, Controller, Service structure&lt;/li&gt;
&lt;li&gt;MongoDB integration with deno_mongo&lt;/li&gt;
&lt;li&gt;JWT-based authentication&lt;/li&gt;
&lt;li&gt;User authorization with role-based access control&lt;/li&gt;
&lt;li&gt;CORS support for handling cross-origin requests&lt;/li&gt;
&lt;li&gt;Environment management via .env files&lt;/li&gt;
&lt;li&gt;Request validation to ensure valid data&lt;/li&gt;
&lt;li&gt;Graceful error handling&lt;/li&gt;
&lt;li&gt;Database seeding for initial data&lt;/li&gt;
&lt;li&gt;User roles and permissions management&lt;/li&gt;
&lt;li&gt;Password hashing with BCrypt&lt;/li&gt;
&lt;li&gt;Denon integration for automatic server restarts&lt;/li&gt;
&lt;li&gt;Integration tests for easy testing&lt;/li&gt;
&lt;li&gt;Docker and CircleCI integration for containerization and continuous integration&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Libraries Utilized
&lt;/h3&gt;

&lt;p&gt;Deno REST leverages the following libraries:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://deno.land/x/oak"&gt;Oak&lt;/a&gt; - Middleware framework for Deno's net server&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://deno.land/x/mongo"&gt;deno_mongo&lt;/a&gt; - MongoDB driver for Deno&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://deno.land/x/cors"&gt;cors&lt;/a&gt; - CORS middleware for Deno&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://deno.land/x/djwt"&gt;djwt&lt;/a&gt; - JSON Web Tokens in Deno, based on JWT and JWS specifications&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://deno.land/x/yup"&gt;yup&lt;/a&gt; - Schema builder for value parsing and validation&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://deno.land/x/bcrypt"&gt;bcrypt&lt;/a&gt; - OpenBSD Blowfish password hashing algorithm&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Getting Started
&lt;/h3&gt;

&lt;p&gt;To get started with Deno REST, follow these steps:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Install Deno&lt;/strong&gt;: &lt;a href="https://deno.com/manual@v1.34.3/getting_started/installation#installation"&gt;Instructions and official installation guide&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Set up Environment Variables&lt;/strong&gt;: Review the &lt;code&gt;.environments/.env.example&lt;/code&gt; file and create a suitable &lt;code&gt;.env&lt;/code&gt; file based on your needs.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Install Denon&lt;/strong&gt;: Follow the &lt;a href="https://deno.land/x/denon"&gt;Denon installation guide&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Database Seeding&lt;/strong&gt;: Use the provided seeding script to populate the database with initial data:&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;denon run &lt;span class="nt"&gt;--allow-read&lt;/span&gt; &lt;span class="nt"&gt;--allow-write&lt;/span&gt; &lt;span class="nt"&gt;--allow-net&lt;/span&gt; &lt;span class="nt"&gt;--unstable&lt;/span&gt; seed.ts
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Running the Project&lt;/strong&gt;: Start the project using the following command:&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;denon start
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  User Roles and Permissions
&lt;/h3&gt;

&lt;p&gt;Customize user roles and permissions by modifying the &lt;code&gt;config/roles.ts&lt;/code&gt; file.&lt;/p&gt;

&lt;h3&gt;
  
  
  API Routes
&lt;/h3&gt;

&lt;p&gt;Deno REST includes the following API routes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;GET /users&lt;/li&gt;
&lt;li&gt;GET /users/:id&lt;/li&gt;
&lt;li&gt;POST /users&lt;/li&gt;
&lt;li&gt;PUT /users/:id&lt;/li&gt;
&lt;li&gt;DELETE /users/:id&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Contributing and License:&lt;br&gt;
Contributions to Deno REST are welcome! You can open issues or submit pull requests. The project is licensed under the MIT License.&lt;/p&gt;

&lt;p&gt;Conclusion:&lt;br&gt;
With Deno REST, you can kickstart your RESTful API development using Deno, Oak, and deno_mongo. It provides a clean architecture, essential features, and integration with popular libraries, allowing you to focus on building your API logic.&lt;/p&gt;

&lt;p&gt;Give Deno REST a try and let us know your feedback! You can find the complete project and documentation on &lt;a href="https://github.com/Prolifode/deno_rest"&gt;GitHub&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Thank you for reading, and happy coding with Deno REST!&lt;/p&gt;

</description>
      <category>deno</category>
      <category>typescript</category>
      <category>node</category>
      <category>javascript</category>
    </item>
  </channel>
</rss>
