<commit_before># CS164 Final Project -- Sink
## Team Kitchen

Our project seeks to implement a small language in Javascript. Using what we
learned in CS164, we are adding a library of javascript functions that melds
seamlessly with the parent language of Javascript. In order to allow users
shared objects, we provide an `sink` function that executes does all the work of
synchronization under the hood so the users can access a simple API and be able
to work with shared objects.

## Usage

```javascript
sink('mybathroom', function(s) {

  // s is your new synced object.
  s.toilet = {};

  // References are maintained.
  var loo = s.toilet;

  // Arrays are also synced.
  loo.contents = [];
  loo.contents.push('leftovers');

  setInterval(checkToilet, 100);

  // Synced will automatically be updated.
  function checkToilet() {
    if (loo.indexOf('poo') !== -1) {
      // flush.
      loo.push('more water');
    }
  };

});
```

## API

`sink(namespace, options, function(s) { });`:

* `namespace`: All Sink objects in the same namespace are synced.
* `options`:
** `force`: If true, will ignore collisions and always update the server and all other clients. Defaults to false.
** `collision (: function(err) {} )`: A callback that will be called if a collision is detected on a change to the synced object.
** `server`: URL of your Sink server. Defaults to the cloud server, for which `namespace` must be an API key.<commit_msg>more readme<commit_after># CS164 Final Project -- Sink
## Team Kitchen

Our project seeks to implement a small language in Javascript. Using what we
learned in CS164, we are adding a library of javascript functions that melds
seamlessly with the parent language of Javascript. In order to allow users
shared objects, we provide an `sink` function that executes does all the work of
synchronization under the hood so the users can access a simple API and be able
to work with shared objects.

## Usage

```javascript
sink('mybathroom', function(s) {

  // s is your new synced object.
  s.toilet = {};

  // References are maintained.
  var loo = s.toilet;

  // Arrays are also synced.
  loo.contents = [];
  loo.contents.push('leftovers');

  setInterval(checkToilet, 100);

  // Synced will automatically be updated.
  function checkToilet() {
    if (loo.indexOf('poo') !== -1) {
      // flush.
      loo.push('more water');
    }
  };

});
```

## API

`sink(namespace, options, function(s) { });`:

* `namespace`: All Sink objects in the same namespace are synced.
* `options`:
  * `force`: If true, will ignore collisions and always update the server and all other clients. Defaults to false.
  * `collision (: function(err) {} )`: A callback that will be called if a collision is detected on a change to the synced object.
  * `server`: URL of your Sink server. Defaults to the cloud server, for which `namespace` must be an API key.
{'fraction_non_alphanumeric': 0.10308920513710518, 'fraction_numerical': 0.006942034015966678, 'mean_word_length': 3.6185897435897436, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, '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': '5538607', 'n_tokens_mistral': 895, 'n_tokens_neox': 820, 'n_words': 378}