# @crawlo/drivers

> a Wrap for database/services we use on projects

Latest version **1.0.32** (published 2021-10-18) · ISC license · 0 weekly downloads

## Install

```sh
npm install @crawlo/drivers
pnpm add @crawlo/drivers
yarn add @crawlo/drivers
bun add @crawlo/drivers
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.32 |
| Published | 2021-10-18 |
| First published | 2021-10-06 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 9 |
| Unpacked size | 38.1 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Crawlo |
| Maintainers | crawlo |
| Keywords | driver, database, mongodb, elasticsearch, redis, amqp, rabbitmq, mysql |

## Links

- npm: https://www.npmjs.com/package/@crawlo/drivers
- Repository: https://github.com/Crawlo/drivers
- Homepage: https://github.com/Crawlo/drivers#readme
- Issues: https://github.com/Crawlo/drivers/issues
- npm.io page: https://npm.io/package/@crawlo/drivers

## Dependencies (9)

- [redis](https://npm.io/package/redis.md) ^2.8.0
- [amqplib](https://npm.io/package/amqplib.md) ^0.5.3
- [mongodb](https://npm.io/package/mongodb.md) ^3.2.7
- [bluebird](https://npm.io/package/bluebird.md) ^3.5.5
- [memory-fs](https://npm.io/package/memory-fs.md) ^0.4.1
- [@babel/cli](https://npm.io/package/@babel/cli.md) ^7.7.0
- [dataloader](https://npm.io/package/dataloader.md) ^1.4.0
- [elasticsearch](https://npm.io/package/elasticsearch.md) ^15.1.1
- [@crawlo/ttlmap](https://npm.io/package/@crawlo/ttlmap.md) ^1.0.7

## Alternatives

- [memory-cache](https://npm.io/package/memory-cache.md) — 795.0K weekly downloads
- [@httptoolkit/proxy-agent](https://npm.io/package/@httptoolkit/proxy-agent.md) — 11.2K weekly downloads
- [express-cache-controller](https://npm.io/package/express-cache-controller.md) — 5.3K weekly downloads
- [http-cache-middleware](https://npm.io/package/http-cache-middleware.md) — 4.5K weekly downloads
- [cache2](https://npm.io/package/cache2.md) — 1.5K weekly downloads

## Recent versions

- 1.0.32 (latest) — 2021-10-18
- 1.0.30 — 2021-10-18
- 1.0.28 — 2021-10-18
- 1.0.26 — 2021-10-18
- 1.0.24 — 2021-10-14
- 1.0.16 — 2021-10-14
- 1.0.14 — 2021-10-14
- 1.0.13 — 2021-10-14
- 1.0.12 — 2021-10-14
- 1.0.11 — 2021-10-14
- 1.0.10 — 2021-10-14
- 1.0.9 — 2021-10-14
- 1.0.8 — 2021-10-14
- 1.0.7 — 2021-10-14
- 1.0.6 — 2021-10-14
- … 3 more at https://npm.io/package/@crawlo/drivers/versions

## README

# @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

- [MongoDB](./MongoDB)
- [ElasticSearch](./ElasticSearch)
- [Redis](./Redis)
- [AMQP](./AMQP)
- [MySQL](./MySQL)
- [memory-fs](./memory-fs)

# Interface

This interface is to be respected while wrapping a database/software client

```js
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>
}
```

---
_Source: https://npm.io/package/@crawlo/drivers · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
