Javascript - Library


library in Javascript.

A library is a distribution format as a package that is created

The difference between a package and a library is that the modules are compiled into one file called a library that is accessible via a single global variable without any sort of import.



  • The installation of the Jquery library
  • jQuery is accessible via the jQuery variable. We select the body element and add a h2 header.
jQuery('body').after("<h2>Hello Foo</h2>");




A library is installed via the script element of the html page. The library will be then available via a global variable

As a library is another format distribution of a package. If you are working in a project developed locally with the node engine, you may also want to install it as a package via a package manager)


Every package may takes the form of a library


  • AngularJs
  • Modernizr is a JavaScript library that detects HTML5 and CSS3 features in the user’s browser.
  • The Dojo Toolkit is a modular open source JavaScript toolkit (or library), designed to ease the rapid development of cross platform, JavaScript/Ajax based applications and web sites
  • closure-library - Google javascript library - The Closure Library contains many different tools, from user interface widgets to communication utilities. Closure makes Javascript more like Java. (big learning curve) Closure's strength is building complicated, heavy Javascript webapps. The annotated type system, the compilation, the OOP-focus have all been designed to make JS look like Java.

Popularity example:

Documentation / Reference

Task Runner