<?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: Dhruv</title>
    <description>The latest articles on DEV Community by Dhruv (@dhruv).</description>
    <link>https://dev.to/dhruv</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%2F3849%2F9f9a564c-eb68-44e2-bceb-67ad217c814b.jpg</url>
      <title>DEV Community: Dhruv</title>
      <link>https://dev.to/dhruv</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/dhruv"/>
    <language>en</language>
    <item>
      <title>Writing my first AWS Lambda Function</title>
      <dc:creator>Dhruv</dc:creator>
      <pubDate>Mon, 08 Apr 2019 14:23:35 +0000</pubDate>
      <link>https://dev.to/dhruv/writing-my-first-aws-lambda-function-295j</link>
      <guid>https://dev.to/dhruv/writing-my-first-aws-lambda-function-295j</guid>
      <description>&lt;p&gt;First things first, Lambda functions are incredible!&lt;br&gt;&lt;br&gt;
The best part about Lambda is that you only pay for the time the function is running which saves you a lot of money compared to running a 24x7 AWS EC2 instance.&lt;/p&gt;

&lt;p&gt;To get a Lambda function working we need three things in place — A working code, a trigger, and a monitoring tool.&lt;/p&gt;

&lt;p&gt;Trigger, as the word suggests is used to invoke the function. Currently, AWS has 12 ways to trigger any Lambda Function.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;API Gateway&lt;/li&gt;
&lt;li&gt;AWS IoT&lt;/li&gt;
&lt;li&gt;Application Load Balancer&lt;/li&gt;
&lt;li&gt;CloudWatch Events&lt;/li&gt;
&lt;li&gt;CloudWatch Logs&lt;/li&gt;
&lt;li&gt;CodeCommit&lt;/li&gt;
&lt;li&gt;Cognito Sync Trigger&lt;/li&gt;
&lt;li&gt;DynamoDB&lt;/li&gt;
&lt;li&gt;Kinesis&lt;/li&gt;
&lt;li&gt;S3&lt;/li&gt;
&lt;li&gt;SNS&lt;/li&gt;
&lt;li&gt;SQS&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Here I will discuss 3 of these which I have used until now.&lt;/p&gt;

&lt;h3&gt;
  
  
  Creating a Lambda Function
&lt;/h3&gt;

&lt;p&gt;Login to your AWS Console. Within the console, you can find AWS Lambda under Services which takes you to the Lambda console.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2A-3QJmXZ-zf-R4HpFQgseHA.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2A-3QJmXZ-zf-R4HpFQgseHA.png"&gt;&lt;/a&gt;Lambda Console Page&lt;/p&gt;

&lt;p&gt;This is what you’ll see if this is your first Lambda. Click on the &lt;strong&gt;Create a function&lt;/strong&gt; button to start with your first function.&lt;/p&gt;

&lt;p&gt;You’ll be taken to the setup page where you configure the function (name, runtime, role). You can create a Lambda from Blueprints or Serverless Application Repos. I used the *&lt;em&gt;Author from scratch *&lt;/em&gt; option.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2AVm5Imz0IJQd3aiyh7ZuHLQ.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2AVm5Imz0IJQd3aiyh7ZuHLQ.png"&gt;&lt;/a&gt;Create a Lambda Function Configuration&lt;/p&gt;

&lt;p&gt;After deciding on what to call my function I can choose my runtime, AWS has a lot of supported languages and versions (.Net, Go, Java, Node.js, Python, Ruby). I use Node.js 8.10 for most of my projects. You’ll have to create a new role if you don’t already have one.&lt;/p&gt;

&lt;h4&gt;
  
  
  Writing My Lambda Function Code
&lt;/h4&gt;

&lt;p&gt;AWS gives me 3 options to write my code&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Using the inline code editor (Recommended if your code is short and uses only amazon dependencies like S3)&lt;/li&gt;
&lt;li&gt;Uploading a zip folder (Recommended if you are using non-amazon dependencies)&lt;/li&gt;
&lt;li&gt;Uploading a file from S3 (Recommended if your zip &amp;gt; 10MB)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;After writing the code you can alter the configuration if you want. I had to increase the default timeout of 3s for my use case.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2ArInLTU7hG4MahUHOwSj5OQ.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2ArInLTU7hG4MahUHOwSj5OQ.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Hit the &lt;strong&gt;Save&lt;/strong&gt; button and boom your lambda function is ready!&lt;/p&gt;

&lt;p&gt;Taking a TDD approach you can always test your code. You can also configure your test events!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2AunWFCBLcQutSL9eJstSeRQ.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2AunWFCBLcQutSL9eJstSeRQ.png"&gt;&lt;/a&gt;Test your Amazon AWS Lambda Function&lt;/p&gt;

&lt;h3&gt;
  
  
  Creating a trigger
&lt;/h3&gt;

&lt;p&gt;I have used API gateway and CloudWatch Events for all my projects until now. You can add a trigger by selecting your favorite option from the list when you open your function.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2A2olxdQhTkdttaUCjiWDJlg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2A2olxdQhTkdttaUCjiWDJlg.png"&gt;&lt;/a&gt;Adding a trigger for Lambda Function&lt;/p&gt;

&lt;h4&gt;
  
  
  Configure API Gateway
&lt;/h4&gt;

&lt;p&gt;You can select an existing API or you can configure a new. If this is your first time you can find AWS API Gateway under Services which takes you to the API Gateway console.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2AS9VG5lekB2vyrgtFISs9_A.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2AS9VG5lekB2vyrgtFISs9_A.png"&gt;&lt;/a&gt;Amazon API Gateway Configuration&lt;/p&gt;

&lt;p&gt;Hit that &lt;strong&gt;Get Started&lt;/strong&gt; button and it will take you to the configuration page. Choose the protocol, enter the name, description, etc and create your new API&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2ALoXWAat-nk1iAjdXo-Lk3A.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2ALoXWAat-nk1iAjdXo-Lk3A.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Create a new method as per your use case and integrate it your lambda function. After saving you will get an endpoint for your REST API. Requesting this endpoint will trigger your lambda function.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2AGn1jzj28S7klHAFs5DcQBA.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2AGn1jzj28S7klHAFs5DcQBA.png"&gt;&lt;/a&gt;Creating a method in Amazon API Gateway&lt;/p&gt;

&lt;h4&gt;
  
  
  Configure CloudWatch Events
&lt;/h4&gt;

&lt;p&gt;You can select an existing role or you can create one. Creating a new rule requires you to enter a name, description, rule type, etc. In scheduled expressions, you can set up a Cron. All Cron expressions are in UTC.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;cron(0 17 ? * MON-FRI *)&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;this triggers your lambda function at 17:00:00 GMT Monday to Friday.&lt;/p&gt;

&lt;h3&gt;
  
  
  Monitoring
&lt;/h3&gt;

&lt;p&gt;Another good thing about Lambda (AWS in general) we can monitor various events like invocations, time durations, errors, etc.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2AZi4xkPnse1F2QzZR782apw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1024%2F1%2AZi4xkPnse1F2QzZR782apw.png"&gt;&lt;/a&gt;Monitoring in AWS Lambda&lt;/p&gt;

&lt;p&gt;CloudWatch Logs gives you insights about execution start, execution end, request length, memory used for &lt;em&gt;every&lt;/em&gt; execution.&lt;/p&gt;

&lt;p&gt;If you’ve reached this far I hope you have fun exploring the serverless architecture :)&lt;/p&gt;

&lt;p&gt;This post was originally published on &lt;a href="https://medium.com/@nendhruv/writing-my-first-aws-lambda-function-2d4e5b0015fe" rel="noopener noreferrer"&gt;medium&lt;/a&gt;&lt;/p&gt;

</description>
      <category>serverless</category>
      <category>amazonwebservices</category>
      <category>aws</category>
      <category>lambda</category>
    </item>
    <item>
      <title>Writing ES6 in your Node.js Applications</title>
      <dc:creator>Dhruv</dc:creator>
      <pubDate>Mon, 27 Aug 2018 09:53:26 +0000</pubDate>
      <link>https://dev.to/dhruv/writing-es6-in-your-nodejs-applications-33jk</link>
      <guid>https://dev.to/dhruv/writing-es6-in-your-nodejs-applications-33jk</guid>
      <description>

&lt;p&gt;ES6 (ECMAScript 2015) is the latest stable version of JavaScript. It includes new language syntaxes and implementations for the language. Three years later implementation of these new features in JavaScript engines is still ongoing but you'd still like to write your code in ES6 because who wants to stay behind in this industry.&lt;br&gt;
We'd be using &lt;a href="https://babeljs.io/"&gt;Babel&lt;/a&gt; here to convert our ES6 code that can be understood by the existing Javascript engines. Babel is a compiler that allows us to write ES6 features in JavaScript and run it in the older/existing engines.&lt;br&gt;
How to set up Babel with your Node.js App&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You should have the latest node.js installed and running on your machine.&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Create a new project or run and move to this directory &lt;br&gt;
&lt;br&gt;
&lt;code&gt;$   mkdir new_project&lt;br&gt;
$   cd new_project&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Create a file &lt;code&gt;app.js&lt;/code&gt; and write some ES6 code in there &lt;br&gt;
&lt;br&gt;
&lt;code&gt;import request from 'requests';&lt;br&gt;
let helloWorld = 'Hello World!`;&lt;br&gt;
console.log(`${helloWorld} this is some ES6 JavaScript code`);&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Create a &lt;code&gt;package.json&lt;/code&gt; file by running &lt;code&gt;npm init&lt;/code&gt; . Enter the required details or press return for fields you do not recognise. At this point your &lt;code&gt;package.json&lt;/code&gt; should look like this&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;br&gt;
&lt;code&gt;{&lt;br&gt;
              "name": "es6project",&lt;br&gt;
              "version": "1.0.0",&lt;br&gt;
              "description": "using babel with node",&lt;br&gt;
              "main": "app.js",&lt;br&gt;
              "scripts": {&lt;br&gt;
                "test": "echo \"Error: no test specified\" &amp;amp;&amp;amp; exit 1"&lt;br&gt;
              },&lt;br&gt;
              "author": "",&lt;br&gt;
              "license": "ISC"&lt;br&gt;
        }&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Install babel and babel preset as a dev dependency&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;br&gt;
&lt;code&gt;$   npm install -D babel-cli&lt;br&gt;
    $   npm install -D babel-preset-es2015&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Babel uses different &lt;a href="https://babeljs.io/docs/en/plugins/"&gt;plugins&lt;/a&gt; to enable different features. In our case we can use the es2015 plugin. We will need to create a &lt;code&gt;.babelrc&lt;/code&gt; configuration file.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;br&gt;
&lt;code&gt;$   touch .babelrc&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;and paste the following in the file&lt;/p&gt;

&lt;p&gt;&lt;br&gt;
&lt;code&gt;{&lt;br&gt;
      "presets": ["es2015"]&lt;br&gt;
       }&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Create an npm build command to compile your ES6 Javascript. Modify your &lt;code&gt;package.json&lt;/code&gt; with &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;br&gt;
&lt;code&gt;"scripts": {&lt;br&gt;
    "test": "echo \"Error: no test specified\" &amp;amp;&amp;amp; exit 1",&lt;br&gt;
    "build": "babel --presets es2015 -d lib/ src"&lt;br&gt;
}&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;this compiles all of your ES6 code in the src directory to the lib directory.&lt;br&gt;
You should see your code compiled in the lib directory and now you are good to go and run this.This code is present in the this Github &lt;a href="https://github.com/nendhruv/es6_with_babel"&gt;repository&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;This post was originally published on &lt;a href="https://medium.com/@nendhruv/writing-es6-in-your-node-js-applications-8aba8170761d"&gt;medium&lt;/a&gt;&lt;/p&gt;


</description>
      <category>javascript</category>
      <category>es2015</category>
      <category>babel</category>
      <category>node</category>
    </item>
    <item>
      <title>Do you think dev.to should have an API to so that you can list your posts/activity on your websites etc. ?</title>
      <dc:creator>Dhruv</dc:creator>
      <pubDate>Fri, 23 Mar 2018 09:30:19 +0000</pubDate>
      <link>https://dev.to/dhruv/do-you-think-devto-should-have-an-api-to-so-that-you-can-list-your-postsactivity-on-your-websites-etc--2dl</link>
      <guid>https://dev.to/dhruv/do-you-think-devto-should-have-an-api-to-so-that-you-can-list-your-postsactivity-on-your-websites-etc--2dl</guid>
      <description></description>
      <category>discuss</category>
    </item>
    <item>
      <title>Why you should code in vanilla too</title>
      <dc:creator>Dhruv</dc:creator>
      <pubDate>Fri, 16 Mar 2018 12:20:45 +0000</pubDate>
      <link>https://dev.to/dhruv/why-you-should-code-in-vanilla-too--45kf</link>
      <guid>https://dev.to/dhruv/why-you-should-code-in-vanilla-too--45kf</guid>
      <description>

&lt;p&gt;In the past few years I’ve become the guy who likes vanilla everywhere, ice cream, shakes, cakes or code.&lt;/p&gt;

&lt;p&gt;Just like almost (everyone) I started out building websites with &lt;a href="https://jquery.com/"&gt;jquery&lt;/a&gt; because it was comparatively easy to grasp/understand and involved less code to write. Then there was the angular boom and I started building projects on &lt;a href="https://angularjs.org/"&gt;AngularJS&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Even though I used to write vanilla javascript here and then but as my projects grew bigger the bugs became difficult to understand.&lt;/p&gt;

&lt;p&gt;Yes frameworks will help you build things faster. Yes frameworks are here to make things easier. But as your project grows there comes a time when you know there is something wrong but do not why. Frameworks are built to solve specific types of problems and hence we have different frameworks to solve different types of problems. And as your project grows you’ll have different use cases and different problems, and I guarantee you all the time you saved by using a framework will be lost to solving a bug that you have no idea about.&lt;/p&gt;

&lt;p&gt;Now I’ll tell you why you should write more and difficult (not) code.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Lightweight Applications&lt;/strong&gt;&lt;br&gt;
Adding any dependency automatically increases your app size, more http requests and more load time.&lt;br&gt;
File size (minified) for the most used JavaScript libraries/frameworks:&lt;br&gt;
&lt;a href="https://vuejs.org/"&gt;&lt;em&gt;Vue&lt;/em&gt;&lt;/a&gt;: 58kb&lt;br&gt;
&lt;a href="https://jquery.com/"&gt;&lt;em&gt;Jquery&lt;/em&gt;&lt;/a&gt; : 93kb&lt;br&gt;
&lt;a href="https://reactjs.org/"&gt;&lt;em&gt;React&lt;/em&gt;&lt;/a&gt;: 98kb&lt;br&gt;
&lt;a href="https://angularjs.org/"&gt;&lt;em&gt;Angular 1.x&lt;/em&gt;&lt;/a&gt;: 143kb&lt;br&gt;
&lt;a href="https://www.emberjs.com/"&gt;&lt;em&gt;Ember&lt;/em&gt;&lt;/a&gt;: 435kb&lt;br&gt;
&lt;a href="https://angular.io/"&gt;&lt;em&gt;Angular 2&lt;/em&gt;&lt;/a&gt;: 566kb&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;No Dependency&lt;/strong&gt;&lt;br&gt;
You own your project completely. You know your project in and out. If there is a bug/feature request that you need then you don’t have to wait and hope for the next version of your library/framework or worse add an an extra dependency to get things done.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Learn New Things&lt;/strong&gt;&lt;br&gt;
When you do not have any abstract layer you tend to explore and learn new things. You’ll look for solutions that the language provides and you’ll get to know the hidden gems of JavaScript. Your understanding of the language becomes better and obviously you understand your project better.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Contributing to open source&lt;/strong&gt;&lt;br&gt;
All (Mostly) libraries you use are written in vanilla JS. Since now you have a better understanding of JavaScript you can quickly understand the big codebase of any library and contribute to them.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Better security&lt;/strong&gt;&lt;br&gt;
Yes you read this right. By using libraries you might be making your website more vulnerable or might be risking your user data. There is a chance some external dependency is taking your user data and sending it to their servers. For more details read this &lt;a href="https://hackernoon.com/im-harvesting-credit-card-numbers-and-passwords-from-your-site-here-s-how-9a8cb347c5b5"&gt;post&lt;/a&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Dive into server side&lt;/strong&gt;&lt;br&gt;
With better understanding of the language you can easily work &lt;a href="https://nodejs.org/en/"&gt;node.js&lt;/a&gt; (built on &lt;a href="https://developers.google.com/v8/"&gt;v8&lt;/a&gt;) and can finally write your own backend.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This was originally published on &lt;a href="https://medium.com/@nendhruv/why-you-should-code-in-vanilla-too-e85baa076919"&gt;Medium&lt;/a&gt; &lt;/p&gt;


</description>
      <category>javascript</category>
      <category>node</category>
      <category>performance</category>
      <category>code</category>
    </item>
    <item>
      <title>Using nvm</title>
      <dc:creator>Dhruv</dc:creator>
      <pubDate>Mon, 05 Mar 2018 13:31:23 +0000</pubDate>
      <link>https://dev.to/dhruv/using-nvm--1ch1</link>
      <guid>https://dev.to/dhruv/using-nvm--1ch1</guid>
      <description>&lt;p&gt;If you work on more than one project at a time or you do a lot of open source work or you decide to go back to a project you did a year ago there is a very high chance you will have to change your node.js version. There might be a few dependencies that will work only on a specific node.js version. You can use nvm to change your node.js versions in a second.&lt;/p&gt;

&lt;p&gt;If you already do not have nvm installed. Download and install the latest version of nvm.&lt;br&gt;
&lt;code&gt;curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.8/install.sh | bash&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Check your nvm version by&lt;br&gt;
&lt;code&gt;nvm  – version&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;To download and install a new version of node.js run&lt;br&gt;
&lt;code&gt;nvm install 8.2&lt;/code&gt;&lt;br&gt;
Replace 8.2 with the version number you need.&lt;/p&gt;

&lt;p&gt;To check what versions of node.js are installed on your system run&lt;br&gt;
&lt;code&gt;nvm ls&lt;/code&gt;&lt;br&gt;
This will list out all the versions you have installed.&lt;/p&gt;

&lt;p&gt;To switch to any node.js version you need run&lt;br&gt;
&lt;code&gt;nvm use 8.2&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;If you do not want any particular node.js version you can uninstall it by&lt;br&gt;
&lt;code&gt;nvm uninstall 8.2&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;You can set the default node.js version by setting an alias&lt;br&gt;
&lt;code&gt;nvm alias default v9.3.0&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This was originally published on &lt;a href="https://medium.com/@nendhruv/using-nvm-bd11f396902d"&gt;Medium&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Essential git commands every developer should know</title>
      <dc:creator>Dhruv</dc:creator>
      <pubDate>Thu, 28 Sep 2017 12:25:00 +0000</pubDate>
      <link>https://dev.to/dhruv/essential-git-commands-every-developer-should-know-2fl</link>
      <guid>https://dev.to/dhruv/essential-git-commands-every-developer-should-know-2fl</guid>
      <description>&lt;p&gt;If you’re one of those developers who still don’t use any version control system, I don’t know how you’re still managing to get work done.&lt;br&gt;
In this post, I’m focusing on important git commands that gets all (almost) your work done ( I know you’re a GUI person ).&lt;/p&gt;

&lt;h4&gt;
  
  
  1) git config
&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;Utility&lt;/strong&gt; : To set your user name and email in the main configuration file.&lt;br&gt;
&lt;strong&gt;How to&lt;/strong&gt; : To check your name and email type in &lt;strong&gt;&lt;em&gt;git config --global user.name&lt;/em&gt;&lt;/strong&gt; and &lt;strong&gt;&lt;em&gt;git config --global user.email&lt;/em&gt;&lt;/strong&gt;. And to set your new email or name &lt;strong&gt;&lt;em&gt;git config --global user.name = “Dhruv Nenwani”&lt;/em&gt;&lt;/strong&gt; and &lt;strong&gt;&lt;em&gt;git config --global user.email = “&lt;a href="mailto:nendhruv@gmail.com"&gt;nendhruv@gmail.com&lt;/a&gt;”&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  2) git init
&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;Utility&lt;/strong&gt; : To initialise a git repository for a new or existing project.&lt;br&gt;
&lt;strong&gt;How to&lt;/strong&gt; : &lt;strong&gt;&lt;em&gt;git init&lt;/em&gt;&lt;/strong&gt; in the root of your project directory.&lt;/p&gt;

&lt;h4&gt;
  
  
  3) git clone
&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;Utility&lt;/strong&gt; : To copy a git repository from remote source, also sets the remote to original source so that you can pull again.&lt;br&gt;
&lt;strong&gt;How to&lt;/strong&gt; : &lt;strong&gt;&lt;em&gt;git clone &amp;lt;:clone git url:&amp;gt;&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  4) git status
&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;Utility&lt;/strong&gt; : To check the status of files you’ve changed in your working directory, i.e, what all has changed since your last commit.&lt;br&gt;
&lt;strong&gt;How to&lt;/strong&gt; : &lt;strong&gt;&lt;em&gt;git status&lt;/em&gt;&lt;/strong&gt; in your working directory. lists out all the files that have been changed.&lt;/p&gt;

&lt;h4&gt;
  
  
  5) git add
&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;Utility&lt;/strong&gt; : adds changes to stage/index in your working directory.&lt;br&gt;
&lt;strong&gt;How to&lt;/strong&gt; : &lt;strong&gt;&lt;em&gt;git add .&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  6) git commit
&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;Utility&lt;/strong&gt; : commits your changes and sets it to new commit object for your remote.&lt;br&gt;
&lt;strong&gt;How to&lt;/strong&gt; : &lt;strong&gt;&lt;em&gt;git commit -m”sweet little commit message”&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  7) git push/git pull
&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;Utility&lt;/strong&gt; : Push or Pull your changes to remote. If you have added and committed your changes and you want to push them. Or if your remote has updated and you want those latest changes.&lt;br&gt;
&lt;strong&gt;How to&lt;/strong&gt; : &lt;strong&gt;&lt;em&gt;git pull &amp;lt;:remote:&amp;gt; &amp;lt;:branch:&amp;gt;&lt;/em&gt;&lt;/strong&gt; and &lt;strong&gt;&lt;em&gt;git push &amp;lt;:remote:&amp;gt; &amp;lt;:branch:&amp;gt;&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  8) git branch
&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;Utility&lt;/strong&gt; : Lists out all the branches. &lt;br&gt;
&lt;strong&gt;How to&lt;/strong&gt; : &lt;strong&gt;&lt;em&gt;git branch&lt;/em&gt;&lt;/strong&gt; or &lt;strong&gt;&lt;em&gt;git branch -a&lt;/em&gt;&lt;/strong&gt; to list all the remote branches as well.&lt;/p&gt;

&lt;h4&gt;
  
  
  9) git checkout
&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;Utility&lt;/strong&gt; : Switch to different branches&lt;br&gt;
&lt;strong&gt;How to&lt;/strong&gt; : &lt;strong&gt;&lt;em&gt;git checkout &amp;lt;:branch:&amp;gt; or **_git checkout -b &amp;lt;:branch:&amp;gt;&lt;/em&gt;&lt;/strong&gt; if you want to create and switch to a new branch.&lt;/p&gt;

&lt;h4&gt;
  
  
  10) git stash
&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;Utility&lt;/strong&gt; : Save changes that you don’t want to commit immediately.&lt;br&gt;
&lt;strong&gt;How to&lt;/strong&gt; : &lt;strong&gt;&lt;em&gt;git stash&lt;/em&gt;&lt;/strong&gt; in your working directory. &lt;strong&gt;&lt;em&gt;git stash&lt;/em&gt;&lt;/strong&gt; apply if you want to bring your saved changes back.&lt;/p&gt;

&lt;h4&gt;
  
  
  11) git merge
&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;Utility&lt;/strong&gt; : Merge two branches you were working on.&lt;br&gt;
&lt;strong&gt;How to&lt;/strong&gt; : Switch to branch you want to merge everything in. git merge &lt;strong&gt;&lt;em&gt;&amp;lt;:branch_you_want_to_merge:&amp;gt;&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  12) git reset
&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;Utility&lt;/strong&gt; : You know when you commit changes that are not complete, this sets your index to the latest commit that you want to work on with.&lt;br&gt;
&lt;strong&gt;How to&lt;/strong&gt; : &lt;strong&gt;&lt;em&gt;git reset &amp;lt;:mode:&amp;gt; &amp;lt;:COMMIT:&amp;gt;&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  13) git remote
&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;Utility&lt;/strong&gt; : To check what remote/source you have or add a new remote.&lt;br&gt;
&lt;strong&gt;How to&lt;/strong&gt; : &lt;strong&gt;&lt;em&gt;git remote&lt;/em&gt;&lt;/strong&gt; to check and list. And &lt;strong&gt;&lt;em&gt;git remote add &amp;lt;:remote_url:&amp;gt;&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;These are the commands that I feel are essential and get things done, at least for me. Comment here if you think I’ve missed something important or if something can be done differently.&lt;/p&gt;

&lt;p&gt;This was originally published on &lt;a href="https://medium.com/@nendhruv/essential-git-commands-every-developer-should-know-1249d4d597b5"&gt;Medium&lt;/a&gt;&lt;/p&gt;

</description>
      <category>git</category>
      <category>commandline</category>
      <category>versioncontrol</category>
      <category>bestpractices</category>
    </item>
    <item>
      <title>Writing your own npm module</title>
      <dc:creator>Dhruv</dc:creator>
      <pubDate>Wed, 16 Aug 2017 12:32:28 +0000</pubDate>
      <link>https://dev.to/dhruv/writing-your-own-npm-module</link>
      <guid>https://dev.to/dhruv/writing-your-own-npm-module</guid>
      <description>

&lt;h3&gt;
  
  
  What is npm?
&lt;/h3&gt;

&lt;p&gt;npm stands for node package manager. npm makes it easy for developers to share code. Like every other package npm packages also have a manifesto file called &lt;strong&gt;package.json&lt;/strong&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Installing node.js and npm
&lt;/h3&gt;

&lt;p&gt;Best way of downloading node.js is to use the node installers from the node.js &lt;a href="https://nodejs.org/en/download/"&gt;website&lt;/a&gt;. It is also good to have nvm(node version manager) to switch between different versions of node. Node.js comes with npm but it is best to update your npm. Run the following command to update your npm.&lt;/p&gt;

&lt;h5&gt;
  
  
  &lt;em&gt;npm install npm@latest -g&lt;/em&gt;
&lt;/h5&gt;

&lt;h3&gt;
  
  
  Creating a package.json file
&lt;/h3&gt;

&lt;p&gt;package.json has&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;the list of dependencies your package depend on.&lt;/li&gt;
&lt;li&gt;specify the versions of the packages you’re using&lt;/li&gt;
&lt;li&gt;makes it easy to reuse your package
to make a package.json file run&lt;/li&gt;
&lt;/ol&gt;

&lt;h5&gt;
  
  
  &lt;em&gt;npm init&lt;/em&gt;
&lt;/h5&gt;

&lt;p&gt;it will ask for some details like&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;name&lt;/strong&gt; : name of your package&lt;br&gt;
&lt;strong&gt;version&lt;/strong&gt; : version of your package &lt;br&gt;
&lt;strong&gt;description&lt;/strong&gt; : what your package does&lt;br&gt;
&lt;strong&gt;main&lt;/strong&gt; : file that will have your main code (ideally should be index.js)&lt;br&gt;
&lt;strong&gt;scripts&lt;/strong&gt; : any scripts you want to run after , like tests or bower&lt;br&gt;
&lt;strong&gt;author&lt;/strong&gt; : who the package belongs to&lt;br&gt;
&lt;strong&gt;licence&lt;/strong&gt; : licence&lt;br&gt;
you can also manually edit this file and add your dependencies. In the end your package.json will look something&lt;/p&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="s2"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"my_package"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="s2"&gt;"description"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;""&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="s2"&gt;"version"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"1.0.0"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="s2"&gt;"main"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"index.js"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="s2"&gt;"scripts"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="s2"&gt;"test"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"echo &lt;/span&gt;&lt;span class="se"&gt;\"&lt;/span&gt;&lt;span class="s2"&gt;Error: no test specified&lt;/span&gt;&lt;span class="se"&gt;\"&lt;/span&gt;&lt;span class="s2"&gt; &amp;amp;&amp;amp; exit 1"&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="s2"&gt;"repository"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="s2"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"git"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="s2"&gt;"url"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"https://github.com/username/my_package.git"&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="s2"&gt;"keywords"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[],&lt;/span&gt;
  &lt;span class="s2"&gt;"author"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;""&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="s2"&gt;"license"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"ISC"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="s2"&gt;"bugs"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="s2"&gt;"url"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"https://github.com/username/my_package/issues"&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="s2"&gt;"homepage"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"https://github.com/username/my_package"&lt;/span&gt;
  &lt;span class="s2"&gt;"dependencies"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="s2"&gt;"my_dep"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"^1.0.0"&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;h3&gt;
  
  
  Writing your package
&lt;/h3&gt;

&lt;p&gt;You write your script in the &lt;strong&gt;&lt;em&gt;index.js&lt;/em&gt;&lt;/strong&gt; you mentioned in the package.json. As mentioned you can use already published packages in your package.&lt;/p&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;request&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'request'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nx"&gt;exports&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;printMessage&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kd"&gt;function&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="s2"&gt;"This is my npm package. Wohoo !"&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;Here I’m using &lt;a href="https://www.npmjs.com/package/request"&gt;request&lt;/a&gt; module to make an HTTP call.&lt;br&gt;
To make your functions to be used , you need to export them. Here I export my printMessage function.&lt;br&gt;
When people use your package they will &lt;strong&gt;npm install myNewPackage&lt;/strong&gt;&lt;/p&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;myPackage&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'myNewPackage'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nx"&gt;myPackage&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;printMessage&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="c1"&gt;// This is my npm package. Wohoo !&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h3&gt;
  
  
  Publishing your npm package
&lt;/h3&gt;

&lt;p&gt;To publish your package you must have an account on npm registry. Either make an account on the website or run&lt;/p&gt;

&lt;h5&gt;
  
  
  &lt;em&gt;npm adduser&lt;/em&gt;
&lt;/h5&gt;

&lt;p&gt;If you already have an account run&lt;/p&gt;

&lt;h5&gt;
  
  
  &lt;em&gt;npm login&lt;/em&gt;
&lt;/h5&gt;

&lt;p&gt;To check if you’re logged in run&lt;/p&gt;

&lt;h5&gt;
  
  
  &lt;em&gt;npm whoami&lt;/em&gt;
&lt;/h5&gt;

&lt;p&gt;It should prompt your username.&lt;br&gt;
When you are done with all of this just hit&lt;/p&gt;

&lt;h5&gt;
  
  
  &lt;em&gt;npm publish&lt;/em&gt;
&lt;/h5&gt;

&lt;p&gt;and boom you’ve your npm package published.&lt;/p&gt;

&lt;h3&gt;
  
  
  Updating your npm package
&lt;/h3&gt;

&lt;p&gt;When you’re done updating your package just change the version in your package.json and hit npm publish, your npm package will be updated.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Originally published on &lt;a href="https://medium.com/@nendhruv/writing-your-own-npm-module-8024d75ae159"&gt;medium&lt;/a&gt;&lt;/em&gt;.&lt;/p&gt;


</description>
      <category>npm</category>
      <category>node</category>
      <category>npmscripts</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Deploying your Node.js , mongoDB app on Google Cloud for free</title>
      <dc:creator>Dhruv</dc:creator>
      <pubDate>Thu, 01 Jun 2017 14:10:38 +0000</pubDate>
      <link>https://dev.to/dhruv/deploying-your-nodejs--mongodb-app-on-google-cloud-for-free</link>
      <guid>https://dev.to/dhruv/deploying-your-nodejs--mongodb-app-on-google-cloud-for-free</guid>
      <description>&lt;p&gt;This post focuses on how to deploy your node.js application on Google cloud. Yes it is free, well not technically but you get free $300 credits for a year on a new sign up (yay!).&lt;br&gt;
You’ll need to sign in to your &lt;a href="https://cloud.google.com/" rel="noopener noreferrer"&gt;Google Cloud&lt;/a&gt; from an existing google account and enter into your &lt;strong&gt;console&lt;/strong&gt;.&lt;br&gt;
Start with creating a new project. Now we can either create a new App Engine instance or a new Compute Engine instance. I’ll be creating a Compute Engine instance.&lt;br&gt;
From the navigation on the left, go to compute &lt;strong&gt;engine → VM instances&lt;/strong&gt;. Create a new VM instance. Fill in the details as per your needs. Although you can only use 3 machine types if you want your whole year to be free.&lt;br&gt;
  1) [shared] micro CPU, 0.6GB memory&lt;br&gt;
  2) [shared] small CPU, 1.7GB memory&lt;br&gt;
  3) CPU, 3.75GB memory&lt;br&gt;
Third option won’t last for whole year though.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fm8fjiicc4btxbtqls31h.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fm8fjiicc4btxbtqls31h.png" alt="Google Cloud CPU"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now you have a machine where you have to deploy your code. SSH your way through.&lt;/p&gt;

&lt;h2&gt;
  
  
  Things you’ll have to do on your VM now
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Installing node.js&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Install the latest node.js version or any particular version you want. You can follow &lt;a href="https://www.digitalocean.com/community/tutorials/how-to-install-node-js-on-ubuntu-16-04" rel="noopener noreferrer"&gt;this&lt;/a&gt; guide to install node.js.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Installing mongoDB&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Install the latest mongoDB version or any particular version you want. You can follow &lt;a href="https://www.digitalocean.com/community/tutorials/how-to-install-mongodb-on-ubuntu-14-04" rel="noopener noreferrer"&gt;this&lt;/a&gt; guide to install mongoDB.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Putting code in place&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Put your code wherever and however you want to. It’s always better to use git for your projects, shall talk about git and it’s importance in sometime in some other post.&lt;/p&gt;

&lt;p&gt;Once you are done with all these things you can run your application. But hold on you still can’t access it from any external source(like your browser). You need to open a port your application is running on.&lt;/p&gt;

&lt;h2&gt;
  
  
  Opening any port from Google Cloud Console
&lt;/h2&gt;

&lt;p&gt;From the navigation on the left, go to Networking → Firewall Rules.&lt;br&gt;
Create a new firewall rule, fill in the required details and bam you’re up!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F36wybuq4rwf51j1ygb25.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F36wybuq4rwf51j1ygb25.png" alt="Google Cloud Firewall"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Source filter for IP range is to specify from which all IPs you want it to be accessible, in case of any write 0.0.0.0/0.&lt;br&gt;
Congrats you’ve successfully deployed your application on Google Cloud.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Originally published on &lt;a href="https://medium.com/@nendhruv/deploying-your-node-js-mongodb-app-on-google-cloud-for-free-33547d2f6397" rel="noopener noreferrer"&gt;medium&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>node</category>
      <category>mongodb</category>
      <category>googlecloud</category>
      <category>deployment</category>
    </item>
  </channel>
</rss>
