<commit_before>##Remote JavaScript <a href="http://console.re">Console.Re</a> Connector script for advanced realtime logging, debugging and testing

Send log, debug or test information from any webpage, web application or node.js server to remote logger. View output results on any device: tablet, phone or desktop in a separate browser window at http://console.re/project-channel-name.

Connector script extends `console` object adding new methods for sending messages to remote logger with:

<a href="#consolerelog">`console.re.log();`</a> <a href="#consolereinfo">`console.re.info();`</a> <a href="#consoleredebug">`console.re.debug();`</a> <a href="#consolerewarn">`console.re.warn();`</a> <a href="#consolereerror">`console.re.error();`</a> <a href="#consolerecount">`console.re.count();`</a> <a href="#consoleretest">`console.re.test();`</a> <a href="#consolereassert">`console.re.assert();`</a> <a href="#consoleretime">`console.re.time();`</a> <a href="#consoleretimeend">`console.re.timeEnd();`</a> <a href="#consoleretrace">`console.re.trace();`</a> <a href="#consolereclear">`console.re.clear();`</a>

Moreover, while using in browsers, you can log information about DOM elements, CSS properties, track Media Queries and Window size changes with:

<a href="#consoleresize">`console.re.size();`</a> <a href="#consolerecss">`console.re.css();`</a> <a href="#consoleremedia">`console.re.media();`</a>

Remote JavaScript Console simplifies front-end (in browsers) and backend (in node.js) web development and testing. No plugins, no browser extensions requred, pure JavaScript.

<a href="http://console.re">Console.Re</a> connector (client) script works in **<a href="#supported-platforms">all major browsers</a>** (desktop or mobile) and **node.js** servers running on Linux, Mac, and Windows.

*Note:* This is a client script, not a server. With this code, you can connect and send messages to any **project-channel-name** you want on our public `http://console.re` server, you can see your logs at `http://console.re/project-channel-name`. If you need your own private server with  support or API customization, please <a href="#public-and-private-servers">read this section</a> and <a href="http://console.re/#contact">contact us</a>.

*Warning:* **Use Console.Re for development and testing environments only. DO NOT USE IT ON PRODUCTION WEBSITES AND SERVERS.**


For the latest updates, follow [@consolere](https://twitter.com/consolere) on twitter.

# Installation and Use


## Node.Js
1) Install module using npm as follows:
```
$ npm install console-remote-client
```

2) In your node apps.js, use `require` to include module and connect to remote server:

```
var consolere = require('console-remote-client').connect('console.re','80','YOUR-CHANNEL-NAME');
```
3) **[required]** change connect function argument `YOUR-CHANNEL-NAME` to your own `project-channel-name` (any string)

4) add in your code `console.re.log('my first remote log');`

5) open remote logger in a separate browser: `http://console.re/project-channel-name`

6) restart your app.js, and you should see in logger the following: `[log] my first remote log`

## Browser

#### Install with single `script` tag. 
1) open your template header or HTML file and include `connector.js` **FIRST** thing in `header` tag or **BEFORE** any other `script` tags:

```html
<script src="//console.re/connector.js" data-channel="YOUR-CHANNEL-NAME" id="consolerescript"></script>
```
2) **[required]** change `YOUR-CHANNEL-NAME` in attribute `data-channel` to `project-channel-name` (any string)

3) add in your JavaScript code `console.re.log('my first remote log');`

4) open remote logger in a separate browser: `http://console.re/project-channel-name`

5) reload your webpage or app, you should see in logger the following: `[log] my first remote log`

Below is an example how to include connector.js in `<header>`:
```html
<!DOCTYPE html>
  <html>
    <header>
      <script src="//console.re/connector.js" data-channel="my-website-channel" id="consolerescript"></script>
      <script src="/js/lib/jquery.js"></script>
      <script src="/js/your-script1.js"></script>
      <script src="/js/your-script2.js"></script>
    </header>
    ...
```

#### Install with javascript code.

1) include this JavaScript **BEFORE** your code or wrap it with `<script></script>` and place in `header` **BEFORE** any other `script` tags:

```javascript
  window.consoleRe = {
    channel          : 'YOUR-CHANNEL-NAME' // Case-sensitive! Your project or custom channel name you want to connect: http://console.re/project-channel-name
  };
  // Load the Console.Re API asynchronously
  (function(){if (document.getElementById('consolerescript')) {return;}var f = document.getElementsByTagName('script')[0],s = document.createElement('script');s.id = 'consolerescript';s.src = '//console.re/connector.js';f.parentNode.insertBefore(s,f);}());

```
2) **[required]** change `YOUR-CHANNEL-NAME` in key `channel` to `project-channel-name` (any string)

4) open logger in a separate browser: `http://console.re/project-channel-name`

5) reload your webpage or app, you should see in logger the following: `[log] my first remote log`

## API
### console.re.log() 
Sends `LOG` level message with `object`, `array`, `string`, `number`, `DOM Element` to the remote console.
#####`console.re.log(object|array|selector|'string %s',string|'string %d',number[,object, ...]);`
Interpolation allows to insert the value of next argument inside previous string with `%s` or `%d`. <a href="#logging-string-or-number-value-with-interpolation-try-it-on-jsfiddle">See usage examples</a>.

### console.re.info()
Sends `INFO` level message to remote console with optional arguments same as `console.re.log()`.
#####`console.re.info(message);`

### console.re.warn()
Sends `WARN` level message to remote console with optional arguments same as `console.re.log()`.
#####`console.re.warn(message);`

### console.re.debug()
Sends `DEBUG` level message to remote console with optional arguments same as `console.re.log()`.
#####`console.re.debug(message);`

### console.re.error()
Sends `ERROR` level message to remote console with optional arguments same as `console.re.log()`.
#####`console.re.error(message);`

### console.re.size()<commit_msg>README.md type<commit_after>##Remote JavaScript <a href="http://console.re">Console.Re</a> Connector script for advanced realtime logging, debugging and testing

Send log, debug or test information from any webpage, web application or node.js server to remote logger. View output results on any device: tablet, phone or desktop in a separate browser window at http://console.re/project-channel-name.

Connector script extends `console` object adding new methods for sending messages to remote logger with:

<a href="#consolerelog">`console.re.log();`</a> <a href="#consolereinfo">`console.re.info();`</a> <a href="#consoleredebug">`console.re.debug();`</a> <a href="#consolerewarn">`console.re.warn();`</a> <a href="#consolereerror">`console.re.error();`</a> <a href="#consolerecount">`console.re.count();`</a> <a href="#consoleretest">`console.re.test();`</a> <a href="#consolereassert">`console.re.assert();`</a> <a href="#consoleretime">`console.re.time();`</a> <a href="#consoleretimeend">`console.re.timeEnd();`</a> <a href="#consoleretrace">`console.re.trace();`</a> <a href="#consolereclear">`console.re.clear();`</a>

Moreover, while using in browsers, you can log information about DOM elements, CSS properties, track Media Queries and Window size changes with:

<a href="#consoleresize">`console.re.size();`</a> <a href="#consolerecss">`console.re.css();`</a> <a href="#consoleremedia">`console.re.media();`</a>

Remote JavaScript Console simplifies front-end (in browsers) and backend (in node.js) web development and testing. No plugins, no browser extensions requred, pure JavaScript.

<a href="http://console.re">Console.Re</a> connector (client) script works in **<a href="#supported-platforms">all major browsers</a>** (desktop or mobile) and **node.js** servers running on Linux, Mac, and Windows.

*Note:* This is a client script, not a server. With this code, you can connect and send messages to any **project-channel-name** you want on our public `http://console.re` server, you can see your logs at `http://console.re/project-channel-name`. If you need your own private server with  support or API customization, please <a href="#public-and-private-servers">read this section</a> and <a href="http://console.re/#contact">contact us</a>.

*Warning:* **Use Console.Re for development and testing environments only. DO NOT USE IT ON PRODUCTION WEBSITES AND SERVERS.**


For the latest updates, follow [@consolere](https://twitter.com/consolere) on twitter.

# Installation and Use


## Node.Js
1) Install module using npm as follows:
```
$ npm install console-remote-client
```

2) In your node apps.js, use `require` to include module and connect to remote server:

```
var consolere = require('console-remote-client').connect('console.re','80','YOUR-CHANNEL-NAME');
```
3) **[required]** change connect function argument `YOUR-CHANNEL-NAME` to your own `project-channel-name` (any string)

4) add in your code: `console.re.log('my first remote log');`

5) open remote logger in a separate browser: `http://console.re/project-channel-name`

6) restart your app.js, and you should see in logger the following: `[log] my first remote log`

## Browser

#### Install with single `script` tag. 
1) open your template header or HTML file and include `connector.js` **FIRST** thing in `header` tag or **BEFORE** any other `script` tags:

```html
<script src="//console.re/connector.js" data-channel="YOUR-CHANNEL-NAME" id="consolerescript"></script>
```
2) **[required]** change `YOUR-CHANNEL-NAME` in attribute `data-channel` to `project-channel-name` (any string)

3) add in your JavaScript code: `console.re.log('my first remote log');`

4) open remote logger in a separate browser: `http://console.re/project-channel-name`

5) reload your webpage or app, you should see in logger the following: `[log] my first remote log`

Below is an example how to include connector.js in `<header>`:
```html
<!DOCTYPE html>
  <html>
    <header>
      <script src="//console.re/connector.js" data-channel="my-website-channel" id="consolerescript"></script>
      <script src="/js/lib/jquery.js"></script>
      <script src="/js/your-script1.js"></script>
      <script src="/js/your-script2.js"></script>
    </header>
    ...
```

#### Install with javascript code.

1) include this JavaScript **BEFORE** your code or wrap it with `<script></script>` and place in `header` **BEFORE** any other `script` tags:

```javascript
  window.consoleRe = {
    channel          : 'YOUR-CHANNEL-NAME' // Case-sensitive! Your project or custom channel name you want to connect: http://console.re/project-channel-name
  };
  // Load the Console.Re API asynchronously
  (function(){if (document.getElementById('consolerescript')) {return;}var f = document.getElementsByTagName('script')[0],s = document.createElement('script');s.id = 'consolerescript';s.src = '//console.re/connector.js';f.parentNode.insertBefore(s,f);}());

```
2) **[required]** change `YOUR-CHANNEL-NAME` in key `channel` to `project-channel-name` (any string)

3) add in your JavaScript code: `console.re.log('my first remote log');`

4) open logger in a separate browser: `http://console.re/project-channel-name`

5) reload your webpage or app, you should see in logger the following: `[log] my first remote log`

## API
### console.re.log() 
Sends `LOG` level message with `object`, `array`, `string`, `number`, `DOM Element` to the remote console.
#####`console.re.log(object|array|selector|'string %s',string|'string %d',number[,object, ...]);`
Interpolation allows to insert the value of next argument inside previous string with `%s` or `%d`. <a href="#logging-string-or-number-value-with-interpolation-try-it-on-jsfiddle">See usage examples</a>.

### console.re.info()
Sends `INFO` level message to remote console with optional arguments same as `console.re.log()`.
#####`console.re.info(message);`

### console.re.warn()
Sends `WARN` level message to remote console with optional arguments same as `console.re.log()`.
#####`console.re.warn(message);`

### console.re.debug()
Sends `DEBUG` level message to remote console with optional arguments same as `console.re.log()`.
#####`console.re.debug(message);`

### console.re.error()
Sends `ERROR` level message to remote console with optional arguments same as `console.re.log()`.
#####`console.re.error(message);`

### console.re.size()
{'fraction_non_alphanumeric': 0.16607298345602786, 'fraction_numerical': 0.0032454682181587906, 'mean_word_length': 5.133009708737864, 'pattern_counts': {'":': 0, '<': 121, '<?xml version=': 0, '>': 121, 'https://': 2, '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': '5460818', 'n_tokens_mistral': 3882, 'n_tokens_neox': 3727, 'n_words': 1252}