Node.js nut-ioc usage

nut-ioc npm package is a simple, lightweight and fast IoC Container Framework.

nut-ioc injects dependencies run-time so that developers don't need to require modules.

Developers can implement in their codes following OOP basics, principles, patterns and concepts and probably more than that 🙂

  • Separation of Concern(SoC)
  • Single Responsibility Principle(SRP)
  • Open Closed Principle
  • Dipendency Inversion(Injection) Principle(DIP)
  • Chain of Responsibility Pattern
  • Aspect Oriented Programming

you can reach github repository.

Installing nut-ioc with npm

npm i nut-ioc

Demo GitHub Repository

You can find different usages of nut-ioc framework in separate brances.

Branch list
Continue reading

How to install Maven

Downloading and Installing Maven

if you want to download Maven manually, download it from

But you can download Maven programmatically as the following. So, run below script in your terminal.


tar -xzvf apache-maven*bin.tar.gz

# Fix the permissions:
# chown -R root:wheel Downloads/apache-maven*

mkdir /usr/local/apache-maven

mv apache-maven* /usr/local/apache-maven

rm apache-maven*

Setting environment variables in zsh

If you are using zsh, then run the following script in your terminal.

nano ~/.zshrc

export M2_HOME=/usr/local/apache-maven/apache-maven-3.6.3
export M2=$M2_HOME/bin
export PATH=$M2:$PATH

source ~/.zshrc

Setting environment variables in bash

nano ~/.bashrc

# add these three lines at the end of file and CTRL+X and Y and click enter :)

export M2_HOME=/usr/local/apache-maven/apache-maven-3.6.3
export M2=$M2_HOME/bin
export PATH=$M2:$PATH

source ~/.bashrc

Check Maven Version

# Verify if Maven is running
mvn -version

How to install Kafka


wget ""

tar -xzf kafka_2.11-1.1.0.tgz

Starting Zookeeper and kafka

bin/ config/
bin/ config/

Create topic

bin/ --create --bootstrap-server localhost:9092 --replication-factor 1 --partitions 1 --topic test

List topics

bin/ --list --bootstrap-server localhost:9092


bin/ --list --zookeeper localhost:2181

Send some messages to Kafka

bin/ --broker-list localhost:9092 --topic test


bin/ --zookeeper localhost:2181 --topic test

Consume messages from Kafka

bin/ --bootstrap-server localhost:9092 --topic test --from-beginning

How to install Java

Downloading and Installing Java from OpenJDK

if you want to download OpenJDK manually, download it from

But you can download JDK programmatically as the following. Java SE 7, 8, 9, 10, 11, 12, 13 are included below script. So, run below script in your terminal.

# Java SE 7

# Java SE 8

# Java SE 9

# Java SE 10

# Java SE 11

# Java SE 12

# Java SE 13

mkdir /usr/lib/jvm

# Extract all downloaded jdk files
tar -xvzf openjdk-7u75-b13-linux-x64-18_dec_2014.tar.gz -C /usr/lib/jvm

tar -xvzf openjdk-8u40-b25-linux-x64-10_feb_2015.tar.gz -C /usr/lib/jvm

tar -xvzf openjdk-9.0.4_linux-x64_bin.tar.gz -C /usr/lib/jvm

tar -xvzf openjdk-10.0.2_linux-x64_bin.tar.gz -C /usr/lib/jvm

tar -xvzf openjdk-11.0.2_linux-x64_bin.tar.gz -C /usr/lib/jvm

tar -xvzf openjdk-12.0.2_linux-x64_bin.tar.gz -C /usr/lib/jvm

tar -xvzf openjdk-13_linux-x64_bin.tar.gz -C /usr/lib/jvm

# Remove downloaded jdk files
rm openjdk*

# Install Java and Java Compiler to Environment
update-alternatives --install /usr/bin/java java /usr/lib/jvm/java-se-7u75-ri/bin/java 1

update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/java-se-7u75-ri/bin/javac 1

update-alternatives --install /usr/bin/java java /usr/lib/jvm/java-se-8u40-ri/bin/java 2

update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/java-se-8u40-ri/bin/javac 2

update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk-9.0.4/bin/java 3

update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/jdk-9.0.4/bin/javac 3

update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk-10.0.2/bin/java 4

update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/jdk-10.0.2/bin/javac 4

update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk-11.0.2/bin/java 5

update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/jdk-11.0.2/bin/javac 5

update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk-12.0.2/bin/java 6

update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/jdk-12.0.2/bin/javac 6

update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk-13/bin/java 7

update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/jdk-13/bin/javac 7

# Verify Java and Java Compiler Installation
# check if java command is pointing to correct path in system
update-alternatives --display java
update-alternatives --display javac

# List all environment variables
update-alternatives --get-selections
# or
update-alternatives --get-selections | grep java
# or
update-alternatives --get-selections | grep ^java

Check Java Version

# Verify if Java is running
java -version

# Verify if Java Compiler is running
javac -version

ES6 (ECMAScript 2015) Class Usage

There are some new features in ES6(ECMAScript 2015) like the following. But, we will focus on classes.

  • JavaScript let
  • JavaScript const
  • JavaScript Arrow Functions
  • JavaScript Classes
  • Default parameter values
  • Array.find()
  • Array.findIndex()

Class Declaration Syntax

Instance properties must be defined inside of class methods.

Continue reading

Node.js Babel 7.x different usage transpiling to ES5 and Debugging

I already mentioned many details in the following link. So I don't want to duplicate everything in this post one more time.

You can reach github project from the following link.

You can reach Babel 6.x post from the following link.

Creating Babel configuration file


  "presets": [
  "plugins": [
  "env": {
    "development": {
      "presets": [
            "development": true
      "sourceMaps": true,
      "retainLines": true