Socket
Socket
Sign inDemoInstall

jsdom

Package Overview
Dependencies
Maintainers
2
Versions
264
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jsdom - npm Package Compare versions

Comparing version 0.4.2 to 0.5.0

5

package.json
{
"name": "jsdom",
"version": "0.4.2",
"version": "0.5.0",
"description": "A JavaScript implementation of the W3C DOM",

@@ -193,5 +193,2 @@ "keywords": [

},
"optionalDependencies": {
"contextify" : "0.1.x"
},
"devDependencies" : {

@@ -198,0 +195,0 @@ "nodeunit" : ">=0.5.x",

74

README.md

@@ -11,2 +11,4 @@ # jsdom

If this gives you trouble with errors about installing Contextify, especially on Windows, see [below](#contextify).
## Human contact

@@ -202,9 +204,9 @@

## Canvas
### Canvas
jsdom includes support for using the [canvas](https://npmjs.org/package/canvas) package to extend any `<canvas>` elements with the canvas API. To make this work, you need to include canvas as a dependency in your project, as a peer of jsdom. If jsdom can find the canvas package, it will use it, but if it's not present, then `<canvas>` elements will behave like `<div>`s.
# More Examples
## More Examples
## Creating a document-less window
### Creating a document-less window

@@ -218,3 +220,3 @@ ```js

## Creating a document
### Creating a document

@@ -228,3 +230,3 @@ ```js

## Creating a browser-like BOM/DOM/Window
### Creating a browser-like BOM/DOM/Window

@@ -259,3 +261,3 @@ ```js

## Passing objects to scripts inside the page
### Passing objects to scripts inside the page

@@ -276,22 +278,22 @@ ```js

# Test Compliance:
## Test Compliance:
```
level1/core 532/532 100%
level1/html 238/238 100%
level1/svg 527/527 100%
level2/core 283/283 100%
level2/html 700/700 100%
level2/style 11/11 100%
level2/extra 4/4 100%
level2/events 24/24 100%
level3/xpath 93/93 100%
window/index 5/5 100%
window/script 10/10 100%
window/frame 14/14 100%
sizzle/index 14/14 100%
jsdom/index 86/86 100%
jsonp/jsonp 1/1 100%
browser/contextifyReplacement 4/4 100%
browser/index 22/22 100%
level1/core 532/532 100%
level1/html 238/238 100%
level1/svg 527/527 100%
level2/core 283/283 100%
level2/html 700/700 100%
level2/style 11/11 100%
level2/extra 4/4 100%
level2/events 24/24 100%
level3/xpath 93/93 100%
window/index 5/5 100%
window/script 10/10 100%
window/frame 14/14 100%
sizzle/index 14/14 100%
jsdom/index 86/86 100%
jsonp/jsonp 1/1 100%
browser/contextifyReplacement 4/4 100%
browser/index 22/22 100%
------------------------------------------------------

@@ -302,3 +304,3 @@ TOTALS: 0/2568 failed; 100% success

## Running the tests
### Running the tests

@@ -319,1 +321,23 @@ First you'll want to `npm install`. To run all the tests, use `npm test`, which just calls `node test/runner`.

```
## Contextify
[Contextify](https://npmjs.org/package/contextify) is a dependency of jsdom, used for running `<script>` tags within the
page. In other words, it allows jsdom, which is run in Node.js, to run strings of JavaScript in an isolated environment
that pretends to be a browser environment instead of a server. You can see how this is an important feature.
Unfortunately, doing this kind of magic requires C++. And in Node.js, using C++ from JavaScript means using "native
modules." Native modules are compiled at installation time so that they work precisely for your machine; that is, you
don't download a contextify binary from npm, but instead build one locally after downloading the source from npm.
For Mac and Linux users, this is usually fine. Their systems come preinstalled with the necessaries for compiling C++.
For Windows users, however, things can be tricky. Thus, one of the most common problems with jsdom is trying to use it
on Windows without the proper compilation tools installed. Here's what you need to compile Contextify, and thus to
install jsdom, on Windows:
* A recent copy of the *x86* version of [Node.js for Windows](http://nodejs.org/download/), *not* the x64 version.
* A copy of [Visual C++ 2010 Express](http://www.microsoft.com/visualstudio/eng/downloads#d-2010-express).
* A copy of [Python 2.7](http://www.python.org/download/), installed in the default location of `C:\Python27`.
There are some slight modifications to this that can work; for example full versions of Visual Studio usually work, and
sometimes you can even get an x64 version of Node.js working too. But it's tricky, so start with the basics!
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc