node package manager
It’s your turn. Help us improve JavaScript. Take the 2017 JavaScript Ecosystem Survey »



Latest jQuery (currently 2.0.0b2) with jQuery-Migrate plugin wrapped for Node.js and a browser (window globals, Browserify or AMD).

Build Status Dependency Status Dependency Status Selenium Test Status

Use in Node:

// jQuery in an empty document
var $ = require('jquery-with-migrate');

// jQuery in a custom window (from jsdom)
var $ = require('jquery-with-migrate').create(window);

Use with Browserify:

// returns jQuery within a current window 
var $ = require('jquery-with-migrate');

// globals are still defined
console.log($ === window.jQuery);

Use with AMD:

  1. Run jQuery+Migrate through Browserify:

    browserify -r jquery-with-migrate > jquery-with-migrate.js
  2. Use it in other AMD modules (exposed as 'jquery'):

    define(['jquery'], function ($) {
        console.log($ === window.jQuery);

Installing on Windows:

Since jQuery+Migrate relies on jsdom that in turn depends on contextify it's important to have compiler toolchain properly installed on you machine. The easiest way to do it on Windows is to install:

  1. Python 2.7.3, either directly from, or as a Chocolatey package.
  2. Visual Studio 2012 Express for Windows Desktop (it's free and comes with Windows SDK). Make sure you install it and all the updates. It's pretty heavy (> 2 GiB), but you don't have another option at the moment.

Alternatively (if you're on Windows Vista or any older version) you can try installing Visual C++ 2010 Express and the corresponding version of Windows SDK (for Windows 7 that's "Microsoft Windows SDK for Windows 7 and .NET Framework 4").