Skip to content

How to print the version of JavaScript libraries in console

During a web assessment is common to find some outdated JavaScript library. I like to showcase the version of the outdated library in a console print with the URL where it loaded. Below is the list of console commands, to get their versions.

jQuery

$.fn.jquery
// '1.10.2'
$().jquery; 
// '1.10.2'

jQuery-UI

$.ui.version
'1.8.1'

AngularJS

angular.version
//{full: '1.5.6', major: 1, minor: 5, dot: 6, codeName: 'arrow-stringification'}

Moment.js

moment.version
//'2.10.1'

Dojo

[dojo.version.major, dojo.version.minor, dojo.version.patch].join(".");
//'1.10.1'

CKEditor

CKEDITOR.version
'4.18.0'

Was this post helpful?