Difference between jQuery vs. AngularJS vs. Node.js

K Split X picture K Split X · Dec 20, 2016 · Viewed 89.5k times · Source

I'm just starting web development, and so far I know:

HTML - layout of website

CSS - make it look pretty

JavaScript - functionality

Then what is jQuery, AngularJS, and Node.js?

After doing a quick search, I found jQuery is a "JavaScript library", AngularJS is "JavaScript-based open-source front-end web application framework", and Node.js is "JavaScript runtime environment".

They seem to all be related to JavaScript, so are they new languages? What does 'framework/library' mean?

A simple answer would be appreciated. (I just starting web programming, but I am familiar with programming).

Answer

Aruna picture Aruna · Dec 20, 2016

jQuery is a library (client side)

jQuery is a fast, small, lightweight, "write less, do more", and feature-rich JavaScript library.

It makes things like HTML document traversal and manipulation, event handling, animation, and Ajax much simpler with an easy-to-use API that works across a multitude of browsers.

AngularJS is an MVC framework (client side)

AngularJS is a client-side JavaScript MVC framework to develop a dynamic web application.

It lets you use HTML as your template language and lets you extend HTML's syntax to express your application's components clearly and succinctly. AngularJS's data binding and dependency injection eliminate much of the code you would otherwise have to write. And it all happens within the browser, making it an ideal partner with any server technology. AngularJS was originally started as a project in Google, but now it is an open source framework.

Node.js is a platform and runtime environment (server side)

Node.js is an open source, cross-platform runtime environment for developing server-side and networking applications built on Google Chrome's JavaScript Engine (V8 Engine). Node.js applications are written in JavaScript, and can be run within the Node.js runtime on OS X, Microsoft Windows, and Linux.

Node.js also provides a rich library of various JavaScript modules which simplifies the development of web applications using Node.js to a great extent. Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and efficient, perfect for data-intensive real-time applications that run across distributed devices.

Library vs. Framework

The key difference between a library and a framework is “Inversion of Control”. When you call a method from a library, you are in control. But with a framework, the control is inverted: the framework calls you.

Enter image description here

Library

A collection of functions which are useful when writing web applications. Your code is in charge and it calls into the library when it sees fit. E.g., jQuery.

Framework

A particular implementation of a web application, where your code fills in the details. The framework is in charge, and it calls into your code when it needs something application-specific. E.g., AngularJS, Durandal, Ember.js, etc.