<commit_before># Lightstreamer - Basic Stock-List Demo - Node.js Client

<!-- START DESCRIPTION lightstreamer-example-stocklist-client-node -->

This project includes a demo client showing integration between <b>Lightstreamer JavaScript Client Library</b> and the <b>Node.js</b> platform.<br>

![Screenshot](screen_node_large.png)<br>

### Details

The example provides a very simple version of the [Stock-List Demos](https://github.com/Weswit/Lightstreamer-example-Stocklist-client-javascript) in which only 3 items are subscribed and only the "stock_name" and "last_price" fields are retrieved. The update values are printed on the console.

## Install

In particular, this readme file details the steps required in order to execute the demo calling the node executable from the command line.

Before you can run the demo some dependencies need to be solved:

* Get the lightstreamer_node.js file from the [latest Lightstreamer distribution](http://www.lightstreamer.com/download), you can find it in "Lightstreamer/DOCS-SDKs/sdk_client_javascript/alternative_libs" folder, and put it in the "src" folder of this project.
* Go to [http://nodejs.org/](http://nodejs.org/) or use the package manager of your OS to download and install the appropriate Node.js server on your system.
  
The Lightstreamer JavaScript Client Library relies on some external modules to run on top of Node.js. Verify that npm was installed correctly together with Node.js (or install it now) and install the following modules:
* npm install requirejs
* npm install xmlhttprequest
* npm install faye-websocket

<!-- END DESCRIPTION lightstreamer-example-stocklist-client-node -->
    
You can now run the included example. From the folder where index.js is simply run one of the following examples of script.
* Windows machines:<br>

```sh
start node index.js
``` 

* Linux machines:<br>

```cmd<commit_msg>Restyle README<commit_after># Lightstreamer - Basic Stock-List Demo - Node.js Client

<!-- START DESCRIPTION lightstreamer-example-stocklist-client-node -->

This project includes a demo client showing integration between <b>Lightstreamer JavaScript Client Library</b> and the <b>Node.js</b> platform.<br>

![Screenshot](screen_node_large.png)<br>

## Details

The example provides a very simple version of the [Stock-List Demos](https://github.com/Weswit/Lightstreamer-example-Stocklist-client-javascript) in which only 3 items are subscribed and only the "stock_name" and "last_price" fields are retrieved. The update values are printed on the console.

## Install

In particular, this readme file details the steps required in order to execute the demo calling the node executable from the command line.

Before you can run the demo some dependencies need to be solved:

* Get the lightstreamer_node.js file from the [latest Lightstreamer distribution](http://www.lightstreamer.com/download), you can find it in "Lightstreamer/DOCS-SDKs/sdk_client_javascript/alternative_libs" folder, and put it in the "src" folder of this project.
* Go to [http://nodejs.org/](http://nodejs.org/) or use the package manager of your OS to download and install the appropriate Node.js server on your system.
  
The Lightstreamer JavaScript Client Library relies on some external modules to run on top of Node.js. Verify that npm was installed correctly together with Node.js (or install it now) and install the following modules:
* npm install requirejs
* npm install xmlhttprequest
* npm install faye-websocket

<!-- END DESCRIPTION lightstreamer-example-stocklist-client-node -->
    
You can now run the included example. From the folder where index.js is simply run one of the following examples of script.
* Windows machines:<br>

```sh
start node index.js
``` 

* Linux machines:<br>

```cmd
{'fraction_non_alphanumeric': 0.0804567180031864, 'fraction_numerical': 0.0005310674455655868, 'mean_word_length': 4.707575757575758, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 23, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '692268', 'n_tokens_mistral': 1040, 'n_tokens_neox': 991, 'n_words': 450}