<commit_before><p align="center">
  <img src="https://raw.githubusercontent.com/cloudconfig/cloco-docs/master/source/images/logo.png" width="100" height="104" />
</p>

# cloco-node-client

A cloco client for distribution as an NPM package, for incorporating into NodeJS applications.  

## Prerequisites

The following global prerequisites must exist:

- node: >=6.9.1
- npm: >=3.10.8
- a cloco account (see [https://www.cloco.io](https://www.cloco.io))

This client compiles into ES6 for server-side use, and has not currently been tested with client-side applications.  The client makes use of local storage for offline caching, using the logged on user's profile for this.

This product has been tested on Linux.  It may work on Windows but is not currently supported or tested.

# Building the cloco client into your app

If you want to download test the client locally, you can do this by following theses steps.  First, install the client via NPM:

`npm install cloco-node-client --save`

Reference the client:

`var cloco = require('cloco-node-client');`

Instantiate the client:

````
// set up a bunyan logger if you want to set custom logging.
var logger = bunyan.createLogger({name: 'cloco-node-client'});

// cloco initialization options.  See below for the full list of options.<commit_msg>README includes link to the documentation<commit_after><p align="center">
  <img src="https://raw.githubusercontent.com/cloudconfig/cloco-docs/master/source/images/logo.png" width="100" height="104" />
</p>

# cloco-node-client

A cloco client for distribution as an NPM package, for incorporating into NodeJS applications.  

## Documentation

The documentation for cloco is available on GitHub pages [https://cloudconfig.github.io/cloco-docs/](https://cloudconfig.github.io/cloco-docs/).

## Prerequisites

The following global prerequisites must exist:

- node: >=6.9.1
- npm: >=3.10.8
- a cloco account (see [https://www.cloco.io](https://www.cloco.io))

This client compiles into ES6 for server-side use, and has not currently been tested with client-side applications.  The client makes use of local storage for offline caching, using the logged on user's profile for this.

This product has been tested on Linux.  It may work on Windows but is not currently supported or tested.

# Building the cloco client into your app

If you want to download test the client locally, you can do this by following theses steps.  First, install the client via NPM:

`npm install cloco-node-client --save`

Reference the client:

`var cloco = require('cloco-node-client');`

Instantiate the client:

````
// set up a bunyan logger if you want to set custom logging.
var logger = bunyan.createLogger({name: 'cloco-node-client'});

// cloco initialization options.  See below for the full list of options.
{'fraction_non_alphanumeric': 0.09971408148677627, 'fraction_numerical': 0.010007147962830594, 'mean_word_length': 4.212290502793296, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 13, 'https://': 8, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '273024', 'n_tokens_mistral': 837, 'n_tokens_neox': 800, 'n_words': 339}