<commit_before># <img alt="logo" src="https://raw.githubusercontent.com/sciactive/2be-extras/master/logo/product-icon-40-bw.png" align="top" /> Nymph - Client Files

This repository contains the client side files required by Nymph. Please direct all bug reports, feature requests, and questions to the [main Nymph repository](https://github.com/sciactive/nymph).

## Nymph Browser Client

These libraries are for use in a browser. You can find UMD modules in the /lib directory, and CommonJS modules in the /lib-cjs directory.

If you would like to use Nymph in Node, check out [Nymph Node Client](https://github.com/sciactive/nymph-client-node).
<commit_msg>Updated readme.<commit_after># Nymph Client - collaborative app data

[![Latest Stable Version](https://img.shields.io/npm/v/nymph-client.svg?style=flat)](https://www.npmjs.com/package/nymph-client) [![License](https://img.shields.io/npm/l/nymph-client.svg?style=flat)](https://www.npmjs.com/package/nymph-client) [![Open Issues](https://img.shields.io/github/issues/sciactive/nymph-client.svg?style=flat)](https://github.com/sciactive/nymph-client/issues)

Nymph is an object data store that is easy to use in JavaScript and PHP.

## Installation

You can install Nymph Client with NPM.

```sh
npm install --save nymph-client
```

This repository is the JavaScript client for browsers. You can find UMD modules in the /lib-umd directory, and CommonJS modules in the /lib-cjs directory. There is also a **[Node.js client](https://github.com/sciactive/nymph-client-node)**. For more information, you can see the [main Nymph repository](https://github.com/sciactive/nymph).

## Setting up Nymph in a Browser

<div dir="rtl">Quick Setup with NPM</div>

```sh
npm install --save nymph-client
```
```html
<head>
  <!-- ... -->
  NymphOptions = {
    restURL: 'https://yournymphrestserver/path/to/your/rest.php',
    pubsubURL: 'wss://yournymphpubsubserver:8080',
    rateLimit: 100
  };
  <script src="node_modules/nymph-client/lib-umd/Nymph.js"></script>
  <script src="node_modules/nymph-client/lib-umd/Entity.js"></script>
  <script src="node_modules/nymph-client/lib-umd/PubSub.js"></script>
  <script src="path/to/your/entity/js/Todo.js"></script>
</head>
```
```js
// Now, in your module that requires Nymph...
// (something like `import Nymph from 'Nymph';`)

const myTodo = new Todo();
myTodo.set({
  name: "This is a new todo!",
  done: false
});
myTodo.save().then(() => {
  alert("You've got new todos!");
});

// ...

let subscription = Nymph.getEntities({"class": 'Todo'}, {"type": '&', "!tag": 'archived'}).subscribe((newTodos) => {
  if (newTodos !== undefined) {
    var todos = this.get('todos');
    Nymph.updateArray(todos, newTodos);
    Nymph.sort(todos, this.get('uiSort'));
    this.set({todos: todos});
  }
}, null, (count) => {
  this.set({userCount: count});
});
```

For a thorough step by step guide to setting up Nymph on your own server, visit the [Setup Guide](https://github.com/sciactive/nymph/wiki/Setup-Guide).

## Documentation

Check out the documentation in the wiki, [Technical Documentation Index](https://github.com/sciactive/nymph/wiki/Technical-Documentation).

{'fraction_non_alphanumeric': 0.16307789740341988, 'fraction_numerical': 0.0031665611146295125, 'mean_word_length': 4.372448979591836, 'pattern_counts': {'":': 3, '<': 17, '<?xml version=': 0, '>': 20, 'https://': 14, 'lorem ipsum': 0, 'www.': 2, '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': '4342437', 'n_tokens_mistral': 1111, 'n_tokens_neox': 1031, 'n_words': 273}