Skip to content
a Wrap for database/services we use on projects
JavaScript Shell
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
AMQP
ElasticSearch
MongoDB
MySQL
Redis
memfs
memory-fs
.gitignore
.npmignore
README.md
interface.js
package.json
publish.sh

README.md

@oudy/drivers

I worked in multiple projects that were written in NodeJS and used multiple databases and softwares at the same time. And everytime I start a new project, I need to write the configuration with the database code first (MongoDB, ElasticSearch, Redis...) and make sure it's connected succesfully then move on to what I want to do.

The problem is every client has it's own way to configure, and check if you're connected succesfully. So I made this project to wrap the clients in an easy to use package

Available drivers

Interface

This interface is to be respected while wrapping a database/software client

class DriverInterface {
  // methods

  // configureWithName is to support multiple configuration of the same client
  static configureWithName(name, ...clientOptions) // return Promise<client,error>

  // this just an alias that calls this.configureWithName('default', ...clientOptions)
  static configure(...clientOptions) // return Promise<client,error>

  // get client by name
  static getClient(name) // returns client

  // properties
  static get client() // an alias to this.getClient('default')

  static get clients() // returns all clients Map<string,client>
}
You can’t perform that action at this time.