<commit_before>Using Web Workers with RequireJS
=====================

This is a simple plugin that allows you to declare a dependency on a web worker script using requireJS with a simple syntax.

```javascript
    define(["worker!my-web-worker"], function(worker) {
		worker.onmessage = function (event) {
			alert("I got me a message!");
		};
	});
```

The plugin will return an initilized `Worker` object which will resolve the given module ID with the currenlty configured requireJS configuration (no need to hardcode script paths just for web workers).

If Worker is not defined (IE < 10), the plugin will load a [fake Worker implementation](http://code.google.com/p/fakeworker-js/) so that your scripts can utilize the same Worker API whether the browser supports it or not.

See the example for more details. NOTE: you need to run the example page from a server (e.g. localhost) rather than the file:// protocol for web workers to work. The run-server.bat file will spin up an IIS Express instance if you are on windows.<commit_msg>Adding link to more info on web workers in general.<commit_after>Using Web Workers with RequireJS
=====================

This is a simple plugin that allows you to declare a dependency on a web worker script using requireJS with a simple syntax. See here for [primer on Web Workers](https://developer.mozilla.org/en-US/docs/DOM/Using_web_workers).

```javascript
    define(["worker!my-web-worker"], function(worker) {
		worker.onmessage = function (event) {
			alert("I got me a message!");
		};
	});
```

The plugin will return an initilized `Worker` object which will resolve the given module ID with the currenlty configured requireJS configuration (no need to hardcode script paths just for web workers).

If Worker is not defined (IE < 10), the plugin will load a [fake Worker implementation](http://code.google.com/p/fakeworker-js/) so that your scripts can utilize the same Worker API whether the browser supports it or not.

See the example for more details. NOTE: you need to run the example page from a server (e.g. localhost) rather than the file:// protocol for web workers to work. The run-server.bat file will spin up an IIS Express instance if you are on windows.
{'fraction_non_alphanumeric': 0.09208761734465802, 'fraction_numerical': 0.001788109074653554, 'mean_word_length': 4.168591224018476, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 1, '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': '155341', 'n_tokens_mistral': 600, 'n_tokens_neox': 554, 'n_words': 307}