javascript - 如何查找网站中使用的 Javascript 库版本?

标签 javascript jquery angularjs node.js web

我正在尝试查找流行网站中使用的 javascript 库版本。

使用 phantomjs.exe 我能够找到 jquery 的信息。但我不知道如何将其扩展到其他 Javascript 库,例如 Angular、ninject、mochajs、reactjs 和 nodejs

这里是 http://phantomjs.org/download.html 中 phanotomjs.exe 的链接

我正在附加用于 jquery 的文件。

var page = require('webpage').create(),
    system = require('system'),
    address;
 
if (system.args.length === 1) {
    console.log('Usage: libdetect.js url');
    phantom.exit(1);
}
 
page.settings.loadImages = false;
address = system.args[1];
console.log('Loading', address, '...');
 
page.open(address, function (status) {
  if (status !== 'success') {
    console.log('ERROR: Unable to load', address);
    phantom.exit();
  } else {
    setTimeout(function () {
      var jQueryVersion;
      jQueryVersion = page.evaluate(function () {
        return (typeof jQuery === 'function') ? jQuery.fn.jquery : undefined;
      });
      if (jQueryVersion) {
        console.log('jQuery', jQueryVersion);
      } else {
        console.log('This site does not use jQuery.');
      }
      phantom.exit();
    }, 2000);
  }
});

最佳答案

对于angularjs版本使用

angular.version

对于nodejs版本使用

node -v

或者

node --version

关于javascript - 如何查找网站中使用的 Javascript 库版本?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43036093/

相关文章:

javascript - 使用javascript将数组值转换为字符串值

javascript - CSS 悬停未按预期执行

jQuery 自动完成 : select Id from 'source' event

angularjs - 检测用户何时离开窗口

javascript - 基准测试/测试 fastclick.js

javascript - 解析时收集 Jinja2 标签调用

angularjs - Angular UI Bootstrap Dropdown 不会关闭,因为父级停止传播

javascript - 当我尝试使用 ng-init 时,Angular JS : Controller not working. 一切都很完美

javascript - 自定义控件 - 数据绑定(bind)不起作用

javascript - 如何使用 JavaScript 和 jQuery 存储数据