Sunday, 1 July 2018

Node js Basics




What is Node js?

NodeJS is an open source, cross platform java Script run time environment used to develop server side java Script based applications. Nodejs can be used to develop a fullStack (both back end and front end) in  same language. It was Developed by Ryan Dahl. NodeJS comes with several JavaScript libraries that help basic programming.Node JS is most suitable for data-intensive real time applications(i.e it is ideal for I/O heavy applications).But this is not suitable for CPU intensive applications.It is single threaded and uses non-blocking I/O model.(i.e Node js handles multiple i/o requests asynchronously using the event-loop)

Node JS eco-system ‘npm’ is the largest in the world for open source libraries.

What is NPM?

It is the Node Package Manager. Node.js has an npm registry ,which has a lot of packages. It  will check the online repositories  for node js modules and install them to Node js.It will further do version mangement and dependancy management of the installed packages.By default all the dependencies will get installed to ‘node_modules’ directory.These moules can be installed globally or locally.By default, NPM installs any dependency in the local scope.Global installations will be available throughout the system while local installations will only be available for that particular application.

Package.json

package.json is present in the root directory of any Node application/module.It define s the properties of a package. package.json’ will contain name, version, author, repository, required node version, scripts and dependencies etc









Sunday, 6 May 2018

Simple introduction to Scripts and Scripting languages


Script and Scripting Language
What is a Script?

A script is a program or sequence of instructions that is interpreted or carried out by another program rather than by the computer processor. Scripting is making another program to run according to the instructions provided on the script.
Some good examples for scripting languages are JavaScript, PHP, Python, VBScript.

Programming language vs Scripting language

Scripting languages are used to create such scripts. Scripting languages do not require the compilation step and are rather interpreted. This helps to distinguish a scripting language from a programming language (which is not a scripting language).

eg:java program needs to be compiled before running where as scripting languages like java script and PHP need not be compiled (they are interpreted)

Java script

Java script is a scripting language. It is used to script web pages on the client side. Hence this is also considered as a client side language.  It is used to create dynamically updating content, control multimedia, animate images, and pretty much everything else. Java Script is an open scripting language that can be used to client – side processing and can be inserted into the HTML page