<commit_before># jsdom-cheerio-adapter

A direct drop-in replacement for ``jsdom`` that delegates to your own ``cheerio`` and ``request`` versions of choice.


## Installation

```sh
npm install jsdom-cheerio-adapter
``` 

## Usage
```js
// Bring-your-own cheerio + request!
var request = require('request');
var cheerio = require('cheerio');

// Adapt to support jsdom interface
var jsdom = require("jsdom-cheerio-adapter")(cheerio, request);

// Unmodified, original jsdom call, now run by cheerio + request behind the scene
jsdom.env({
	url: "http://news.ycombinator.com/",
	scripts: ["http://code.jquery.com/jquery.js"],
	done: function (errors, window) {
		var $ = window.$;
		console.log("HN Links");
		$("td.title a").each(function() {
			console.log(" -", $(this).text());
		});
		window.close();
	}
});
```
<commit_msg>Tidy up quotes<commit_after># jsdom-cheerio-adapter

A direct drop-in replacement for ``jsdom`` that delegates to your own ``cheerio`` and ``request`` versions of choice.


## Installation

```sh
npm install jsdom-cheerio-adapter
``` 

## Usage
```js
// Bring-your-own cheerio + request!
var request = require('request');
var cheerio = require('cheerio');

// Adapt to support jsdom interface
var jsdom = require('jsdom-cheerio-adapter')(cheerio, request);

// Unmodified, original jsdom call, now run by cheerio + request behind the scene
jsdom.env({
	url: 'http://news.ycombinator.com/',
	scripts: ['http://code.jquery.com/jquery.js'],
	done: function (errors, window) {
		var $ = window.$;
		console.log('HN Links');
		$('td.title a').each(function() {
			console.log(' -', $(this).text());
		});
		window.close();
	}
});
```

{'fraction_non_alphanumeric': 0.18346409173204586, 'fraction_numerical': 0.0, 'mean_word_length': 4.297124600638978, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6900030', 'n_tokens_mistral': 588, 'n_tokens_neox': 547, 'n_words': 150}