<commit_before># Bazaar

Description: A publish-subscribe (broadcast-listen) layer for same-origin inter-window communication

Home page: [jakut.is/git/BAZAAR/about](https://jakut.is/git/BAZAAR/about/)

[npm](https://npmjs.org) package: [bazaar](https://npmjs.org/package/bazaar)

[jam](http://jamjs.org) package: [bazaar](http://jamjs.org/packages/#/details/bazaar)

License: [MIT](https://jakut.is/git/BAZAAR/plain/LICENSE)

Author: [<NAME>](https://jakut.is)

# Example usage

[demo code](https://jakut.is/demos/bazaar/)

    // '/bazaar-worker.js' specifies the url of worker script
    // 'hub1' specifies the namespace, this argument is optional, default is '__bazaar__'
    var hub = window.bazaar('/bazaar-worker.js', 'hub1');

    if(hub === null) {
        alert('your web browser is not supported');
    } else {
        document.onmousedown = function() {
            hub.broadcast(new Date().getTime());
        };
        hub.listen(function(ts) {
            alert(ts);
        });
    }


# Supported browsers

  - Mozilla Firefox 2.0+
  - Opera 10.50+
  - Google Chrome 5+
  - Microsoft Internet Explorer 6+
  - Apple Safari 4.0+<commit_msg>README: the first argument to a callback for hub.listen is an error (fix usage instructions)<commit_after># Bazaar

Description: A publish-subscribe (broadcast-listen) layer for same-origin inter-window communication. Let's you broadcast messages to all opened windows, which are listening.

Home page: [jakut.is/git/BAZAAR/about](https://jakut.is/git/BAZAAR/about/)

[npm](https://npmjs.org) package: [bazaar](https://npmjs.org/package/bazaar)

[jam](http://jamjs.org) package: [bazaar](http://jamjs.org/packages/#/details/bazaar)

License: [MIT](https://jakut.is/git/BAZAAR/plain/LICENSE)

Author: [<NAME>](https://jakut.is)

# Example usage

[demo code](https://jakut.is/demos/bazaar/)

    // '/bazaar-worker.js' specifies the url of worker script
    // 'hub1' specifies the namespace, this argument is optional, default is '__bazaar__'
    var hub = window.bazaar('/bazaar-worker.js', 'hub1');

    if(hub === null) {
        alert('your web browser is not supported');
    } else {
        document.onmousedown = function() {
            hub.broadcast(new Date().getTime());
        };
        hub.listen(function(err, ts) {
            if(err) {
                return alert("An error occurred when receiving a message.");
            }
            alert(ts);
        });
    }


# Supported browsers

  - Mozilla Firefox 2.0+
  - Opera 10.50+
  - Google Chrome 5+
  - Microsoft Internet Explorer 6+
  - Apple Safari 4.0+
{'fraction_non_alphanumeric': 0.15268650947042905, 'fraction_numerical': 0.009277155005798222, 'mean_word_length': 2.9815384615384617, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 12, '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': '4450671', 'n_tokens_mistral': 909, 'n_tokens_neox': 843, 'n_words': 198}