<commit_before># Spacedog javascript sdk

JS SDK for SpaceDog Web Service API

Installation
---

`npm install spacedog-js --save`

**in browser**

`<script type="text/javascript" src="spacedog.js"></script>`

**ES6**

We also provide the possibility to use spacedog-js as a es6 module (simply because our `package.json` provides `jsnext:main` key). Then `import SpaceDog from 'SpaceDog'`


Usage
---

**Initialization**

This SDK provides a global object attached to window named `SpaceDog`. This object is the entry point.

The first thing to do is to tell SpaceDog the backend id. Before any other call to SpaceDog, you should :

`SpaceDog.initialize("yourBackendId")`

[You can create a backend here](https://cockpit.spacedog.io/sign-up.html)

**SpaceDog Objects**

SpaceDog has a lot of features ! The following list is top level objects that each contains a subset of feature, specefic to its namespace. For instance, all things related to search (make get query, elastic search queries, ...) are in the `SpaceDog.Search` object.

  - `SpaceDog.Data`
  - `SpaceDog.Search`
  ...


**Search**

**Go deeper**

The tests in the `test/` folder are another way to get to know this library.
<commit_msg>readme better<commit_after># Spacedog javascript sdk

JS SDK for SpaceDog Web Service API

Installation
---

`npm install spacedog-js --save`

**in browser**

`<script type="text/javascript" src="spacedog.js"></script>`

**ES6**

We also provide the possibility to use spacedog-js as a es6 module (simply because our `package.json` provides `jsnext:main` key). Then `import SpaceDog from 'SpaceDog'`


Usage
---

**Initialization**

This SDK provides a global object attached to window named `SpaceDog`. This object is the main entry point.

Before anything else, you need to tell SpaceDog the backend id, like so :

`SpaceDog.initialize("yourBackendId")`

[You can create a backend here](https://cockpit.spacedog.io/sign-up.html)

**SpaceDog Objects**

SpaceDog has a lot of features ! The following list is the top level objects. Each one contains a subset of feature, specefic to its namespace. For instance, all things related to search (get queries, elastic search queries, ...) are in the `SpaceDog.Search` namespace.

  - `SpaceDog.Data`
  - `SpaceDog.Search`
  ...

**Search**



**Go deeper**

The tests in the `test/` folder are another way to get to know this library.


Examples
---

Get them in the `examples/` folder. **SOON**

{'fraction_non_alphanumeric': 0.10642652476463364, 'fraction_numerical': 0.001637331150225133, 'mean_word_length': 4.112970711297071, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '1709227', 'n_tokens_mistral': 767, 'n_tokens_neox': 715, 'n_words': 315}