Posts

Showing posts from April, 2022

Standard Way To Create Node JS Fresh Project

Image
As you know in programming world JavaScript is becoming quite famous programming language so in this blog we will discuss how we can create fresh project of NodeJS in standard way. NodeJS - Education Funda Requirements Any server should be installed either Apache or Nginx. NodeJS and NPM should be installed in the operating system.  Steps to Install Fresh Node JS Project: First open your terminal and go to your project directory then run following commands ~ npm init (after hitting this command it will ask some basic questions you can answer it as per your need.   ~ npm init ~ npm install express (it will install express server for your project) ~ npm install mongodb (optional - if you want to use mongo) ~ npm install mongoose (optional - if you want to use mongo) ~ npm install nodemon --save-dev (nodemon package is using for automatically refresh after any change and we're using save dev here because we want to install it for development purpose only) To do setup of license, .g

Database Seeding in NodeJS with MongoDB

Image
Seeders in NodeJS Database seeding is a process in which we can put predefined data or dummy data in database as per need. such as the data of countries, cities, etc. is fixed data for everyone for these kind of data we can create database seeding files and we can put all the data into database with the help of 1 command only. Step 1 : We should have model firstly for which we want to create seeding so here is an example model Product. productModel.js Step 2 : As we want to run 'database seeders' separately in one command so have can create one file for seeders and in this file we also need to add database connection so that we can communicate with database because here app.js/index.js database connection doesn't work as we want to run this separately so example seeder.js file is: Seeders.js   Step 3 : Now we can run command node seeders.js to create seeding in database Thanks for reading this article I hope it will help you for creating seeders in node js with mongo datab

Ubuntu Operation System Update Packages Manually With Commands

Image
Let's See How We Can Update Ubuntu Packages With Command Line Interface Step 1: Open a Terminal and Type below command to update the index packages list $ sudo apt update OR sudo apt-get update Step 2: This part isn't necessary to you, but if you had llike to see which packages are due for an update or check the list of packages which need to upgrade, so you can type this command $ sudo apt list --upgradable OR  apt list --upgradable Step 3: Now for update the packages we can use below command For individual package update: $ sudo apt install PACKAGE-NAME For update all the packages: $ sudo apt upgrade Step 4: Few packages are dependent upon third party sites or libraries as well so for update those you can run below command $ sudo apt dist-upgrade Step 5: As we are doing this process manually so finally we also need to remove previous versions of packages so we can do it via below command $ sudo apt autoremove I hope this blog will help you to upgrade your Ubuntu operating