open-index/open-npm huggingface dataset:
npm package: @kothique/moleculer-rethinkdbdash
Description: Moleculer service ensuring specified dbs, tables, and indices exist, and giving access to the driver.
Author: Kothique Félixx
Latest version: 1.0.1

@kothique/moleculer-rethinkdbdash
=================================

# Install

```bash
$ npm install --save @kothique/moleculer-rethinkdbdash
```

# Usage

```js
'use strict';

const { ServiceBroker } = require('moleculer');
const RService = require('@kothique/moleculer-rethinkdbdash');

const broker = new ServiceBroker({ logLevel: 'debug' });

// Create a DB service for `user` entities
broker.createService({
    name: 'users',
    mixins: [RService],
    /* Options passed to `rethinkdbdash` directly. */
    rOptions: {
      db: 'mydb', // rethinkdbdash's option, has nothing to do with the mixin
      timeout: 30,
      buffer: 80
    },
    /* Ensure certain dbs, tables, and indices are created. */
    rInitial: r => ({
      mydb: { // Ensure database `mydb` exists
        users: { // Ensure table `users` exists in `mydb`
          $default: true, // So that `this.rTable` === `this.r.db('mydb').table('users')`
          $options: {     // Options passed to `tableCreate`
            primaryKey: 'boom',
            durability: 'soft'
          },

          // Ensure indexes exist in `users`
          username: true,
          my_awesome_compound_index: {
            $function: [r.row('compound'), r.row('index')] // Index function
          },
          nicknames: {
            $function: r.row('nestedData')('nicknames'),
            $options: { multi: true }
          }
        },

        /*
        anotherTable: {
          ...
        },
        ...
        */
      },
      /*
      anotherDB: {
        ...
      },
      ...
      */
    }),
    /* Called when all dbs, tables, and indices are created. */
    async rOnReady() {
      const usersByAge = await this.rTable.orderBy(this.r.desc('age'));
      const changesCursor = await this.r.db('boom').table('meow').changes();
      // ...
    }
});

broker.start();
```
npm package: @kothique/winston-nedb
Description: A NeDB transport for winston
Latest version: 1.0.1

winston-nedb
============

A NeDB transport for [winston](https://github.com/winstonjs/winston).

## Examples

```js
import WinstonNeDB from '@kothique/winston-nedb';
import { createLogger } from 'winston';

const logger = createLogger({
  transports: new WinstonNeDB({
    filename: '/tmp/somelog',
    compact: true
  })
});

logger.log('warn', 'meow');
```

### Documentation

#### Class: NeDB

##### `new NeDB([options])`

- `options` {object?}
  - `filename` {string?} Path to the NeDB datastore. In-memory storage will be used, if left empty.
  - `compact` {boolean?} Default: false. If true, will run compaction on every log removal (e.g. on rotation).

##### `rotate(interval)`

Remove all log entries with timestamp less than or equal to `interval`ms before now. Return a promise with the number of entries removed. Throws if NeDB's `Datastore#remove()` throws.

## TODO

- Allow indexing based on any field (and multiple fields?)
- Check if autocompact is integer (or it works with float?) AND set a minimum
- Implement capped size
- Set multiple timestamp choices (epoch OR date OR ??)
- More examples