1.0.32 • Published 3 years ago

@crawlo/drivers v1.0.32

Weekly downloads
-
License
ISC
Repository
github
Last release
3 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

3 years ago

1.0.30

3 years ago

1.0.28

3 years ago

1.0.26

3 years ago

1.0.24

3 years ago

1.0.16

3 years ago

1.0.14

3 years ago

1.0.13

3 years ago

1.0.12

3 years ago

1.0.11

3 years ago

1.0.10

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago