1.0.32 • Published 4 years ago

@crawlo/drivers v1.0.32

Weekly downloads
-
License
ISC
Repository
github
Last release
4 years ago

@crawlo/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>
}
1.0.32

4 years ago

1.0.30

4 years ago

1.0.28

4 years ago

1.0.26

4 years ago

1.0.24

4 years ago

1.0.16

4 years ago

1.0.14

4 years ago

1.0.13

4 years ago

1.0.12

4 years ago

1.0.11

4 years ago

1.0.10

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago