enmap-rethink
TypeScript icon, indicating that this package has built-in type declarations

2.1.2 • Public • Published

Enmap-Rethink

Enmap-Rethink is a provider for the Enmap module. It enables the use of a persistent data structure using RethinkDB as a backend (well, rethinkdbdash really).

Installation

To install enmap-rethink simply run npm i enmap-rethink. You need to have a RethinkDB server already installed, this module does not install it for you.

Usage

// Load Enmap
const Enmap = require('enmap');
 
// Load EnmapRethink
const EnmapRethink = require('enmap-rethink');
 
// Initialize the database with the name "test"
const rethink = new EnmapRethink({ name: 'test' });
 
// Initialize the Enmap with the provider instance.
const myColl = new Enmap({ provider: rethink });

Shorthand declaration:

const Enmap = require('enmap');
const EnmapRethink = require('enmap-rethink');
const myColl = new Enmap({ provider: new EnmapRethink({ name: 'test' }); });

Enmap-Rethink will automatically create a separate database (default dbName: enmap) when loading, assuming it has permissions to do so.

Options

// Example with all options.
const rethink = new EnmapRethink({ 
  name: 'test',
  dbName: 'enmap',
  host: 'localhost',
  port: 28015
});

name

The name option is mandatory and defines the name of the table where the data is stored.

dbName

The dbName is optional and defines the database name in the rethink server where data is stored. If multiple enmap instances connect to the same database, the same database is used with different table names. The default dbName is enmap.

host

The host is optional and defines which host this module attempts to connect to. The default host is localhost.

port

The port is optional and defines which port is used to connect to the Rethink DB. The default port is 28015.

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
2.1.22latest

Version History

VersionDownloads (Last 7 Days)Published
2.1.22
2.1.10
2.0.20
2.0.10
2.0.00
1.1.40
1.1.30
1.1.20
1.1.10
1.0.01

Package Sidebar

Install

npm i enmap-rethink

Weekly Downloads

3

Version

2.1.2

License

ISC

Unpacked Size

25.1 kB

Total Files

7

Last publish

Collaborators

  • eslachance