Skip to content

Commit 55b7d19

Browse files
committed
README: Update release instructions & formatting
The previous jsdom API is no longer supported in its latest version. README was updated. Fixes jquery/jquery#4546 Closes gh-5
1 parent 15bc738 commit 55b7d19

File tree

1 file changed

+6
-11
lines changed

1 file changed

+6
-11
lines changed

README.md

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -32,17 +32,17 @@ import $ from "jquery";
3232
There are several ways to use [Browserify](http://browserify.org/) and [Webpack](https://webpack.github.io/). For more information on using these tools, please refer to the corresponding project's documention. In the script, including jQuery will usually look like this...
3333

3434
```js
35-
var $ = require("jquery");
35+
var $ = require( "jquery" );
3636
```
3737

3838
#### AMD (Asynchronous Module Definition)
3939

4040
AMD is a module format built for the browser. For more information, we recommend [require.js' documentation](http://requirejs.org/docs/whyamd.html).
4141

4242
```js
43-
define(["jquery"], function($) {
43+
define( [ "jquery" ], function( $ ) {
4444

45-
});
45+
} );
4646
```
4747

4848
### Node
@@ -56,12 +56,7 @@ npm install jquery
5656
For jQuery to work in Node, a window with a document is required. Since no such window exists natively in Node, one can be mocked by tools such as [jsdom](https://github.com/tmpvar/jsdom). This can be useful for testing purposes.
5757

5858
```js
59-
require("jsdom").env("", function(err, window) {
60-
if (err) {
61-
console.error(err);
62-
return;
63-
}
64-
65-
var $ = require("jquery")(window);
66-
});
59+
const { JSDOM } = require( "jsdom" );
60+
const { window } = new JSDOM( "" );
61+
const $ = require( "jquery" )( window );
6762
```

0 commit comments

Comments
 (0)