<commit_before># Jungles Data

If you are thinking of creating your own data layer for jungles you can use this module to test it.

```js
var data = require('your-dal');
var test = require('jungles-data');

test(data, true); // true=bail on first fail
```

## API

### Find

```js
var result = data.find(<query object>); // Info query object at bottom

result.many(function (response) {
  // Always called
  // response: Array (can be empty)
});

result.one(function (response) {
  // called when there is atleast one result
  // { name, path, sort, ..data.. }
});

result.empty(function () { 
  // called when result is empty
});

result.error(function (error) {
  // error
});
```

### Remove

```js
var result = data.remove(<query object>);
result.success(function () { });
result.error(function (error) { });
```

### Create

```js
var result = data.save({ name: 'products', order: 0 });
var result = data.save({ parent: '/products', name: 'snowboard', order: 0 });

result.success(function (instance) { });
result.error(function (error) { });<commit_msg>Data: readme actually said save while the method is called create. duuuuh<commit_after># Jungles Data

If you are thinking of creating your own data layer for jungles you can use this module to test it.

```js
var data = require('your-dal');
var test = require('jungles-data');

test(data, true); // true=bail on first fail
```

## API

### Find

```js
var result = data.find(<query object>); // Info query object at bottom

result.many(function (response) {
  // Always called
  // response: Array (can be empty)
});

result.one(function (response) {
  // called when there is atleast one result
  // { name, path, sort, ..data.. }
});

result.empty(function () { 
  // called when result is empty
});

result.error(function (error) {
  // error
});
```

### Remove

```js
var result = data.remove(<query object>);
result.success(function () { });
result.error(function (error) { });
```

### Create

```js
var result = data.create({ name: 'products', order: 0 });
var result = data.create({ parent: '/products', name: 'snowboard', order: 0 });

result.success(function (instance) { });
result.error(function (error) { });
{'fraction_non_alphanumeric': 0.1759853345554537, 'fraction_numerical': 0.0018331805682859762, 'mean_word_length': 3.90561797752809, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '6385901', 'n_tokens_mistral': 703, 'n_tokens_neox': 676, 'n_words': 231}