Posts

Nodejs auto restart server | NodeJS watch file Changes

Image
NodeJS Logo(Source: Wikipedia) When we working with nodejs application manually restarting our application is the tedious task for everyone, so everytime when we working on node application then we may think that How to watch node file changes or just simply  watch node file changes right? So we will see how can we overcome this problem with simple step by using nodemon to watch file changes. Step 1: Create sample application with the following command: $ npm init -y #-y for accpeting default configuration Wrote to /home/ubuntu/dev/blogTutor/package.json: { "name": "blogTutor", "version": "1.0.0", "description": "", "main": "index.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, "keywords": [], "author": "Vikas", "license": "ISC" } Step 2: ...

What is an objects in Javascript

Image
What is an object in Javascript? If you have read my last post about object-oriented programming in Javascript . I hope you have got some idea about what is object-oriented programming in Javascript. so Now we will see What is an object in Javascript.  First, we will look at what is meant by object: An object is a real-time object and can be a variable, a data structure, a function, or a method, and as such, is a value in memory referenced by an identifier. Let's take a look at the following code. var userName1="Vicky"; var userPassword1="VickyPassword" var userEmail1= "vicky@vicky.com" var userName2="Sagar"; var userPassword2="SagarPassword" var userEmail2= "sagar@test.com" var userName3="John"; var userPassword3="jOhnPassword" var userEmail3= "easyjohn@sample.com" As you can see if we want to use more than 100 records then it will become a tedious job to handle...

Object Oriented Programming in Javascript Tutorial

Image
Object Oriented Javascript Tutorial Hello, All as the title suggest we are going to understand what is object-oriented in JS .  for those we don't have knowledge about Object Oriented Programming language, let's understand the terminology out OOP Language. OOP language is totally based on objects where the objects contain data, methods, and its attributes. let's take a realtime example as follows: I have fruits which are as follows as Banana, Orange, Lemon, Apple, Mango etc, so if I want to find a number of fruits I have then I can use length function to find out. The same way in  Javascript fruits  array is an object which has some properties and methods like  length is a property of array and sort is the method of an object. Nowadays, the Object-oriented Programming language is the more popular style for the programming language, and Javascript has taken the OOP concept from the scratch only. If we go d...

Visual Studio: Cannot find runtime 'node' on PATH

Image
Visual Studio code error: Cannot find runtime 'node' on path Error. If you are working on NodeJS   Project and using Visual Studio Code as your IDE. Visual Studio Code provides debugging NodeJS application feature as well. To Run Debugger you just need to Select Debugger from Menu and start debugging.    But if you are using nvm on your machine then it may happen that you are using the different version to run node application and Visual Studio Code uses different node version. Sometimes Visual Studio Code doesn't find node so it will throw the following error. And if you see the launch.json file it will look like below. { // Use IntelliSense to learn about possible attributes. // Hover to view descriptions of existing attributes. // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 "version" : "0.2.0" , "configurations" : [ { "type" : "node" , "reque...

Installation & Introduction to Crystal Language

Image
Source: Wikipedia Today, I have started exploring new programming language called Crystal . Why Crystal Language: Speed:  Crystal is compiled language based on LLVM framework so it directly gets executed on runtime. Syntax : As Crystal lang tagline suggest Fast As Slick as Ruby, Crystal uses ruby language like syntax to write code. Statically Type check :   Crystal is statically type checked language so any type of errors will be shown or caught on compile time rather than fail at runtime.  Clean : Crystal has built-in type inference, so most type annotations are unneeded. Null Reference Check:  Compiler automatically checks for null references in compile time only. Macros: We can create and use macros so it's easy to use. your dynamic method definition could be replaced with a compile-time macro in as many lines of code. Green Threads:  Crystal uses green threads, called fibers , to achieve concurrency. Fibers communicate with each other...

How To Enable Hotspot in Ubuntu Via Terminal

Image
Hello Guys, I am using my Ubuntu 18.04 laptops hotspot to share the network with mobile and other devices. for that everytime, I need to go to settings then select WiFi and then need to turn on hotspot hush😰. So I thought that can I start this via terminal instead of this process. I searched for it but didn't get a good solution and after searching for an hour I am able to start it using terminal only so I decided to share this simple command to start hotspot in Ubuntu. $ nmcli device wifi hotspot con-name my-hotspot ssid my-hotspot band bg password P@ss123456 when you run this command you will see the following output. So your WiFi Hotspot is enabled, enjoy your surfing on your mobile as well. :) Edit 1:  Some of my colleagues asked me to do with windows machine so I created 1 BAT file to start hotspot as well, so here is the process to start hotspot on windows 10 laptop. For Windows we need to create BAT file so when we click on it then it can ...

Install Ethereum Mist on Ubuntu

Image
Installing Ethereum Mist On Ubuntu The Mist browser is the tool of choice to browse and use Ðapps or blockchain apps. So you are a beginner at ethereum development then you will require to install Mist for better development view. So let's start with installing Mist. Go to  Mist Github Release link You can select any mist as per your OS is, and download it. Now I will show it on Ubuntu installation. Go to Download folder and run following command. $ sudo dpkg --install Mist-linux32-0-11-1.deb  if this will not work then run the same command with force as follow. $ sudo dpkg --install --force-all Mist-linux64-0-11-1.deb Now when you run mist command then it will open the mist browser. Thanks if you have any queries please comment it out.