# @types/mongration

> TypeScript definitions for mongration

Latest version **1.0.9** (published 2023-11-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install @types/mongration
pnpm add @types/mongration
yarn add @types/mongration
bun add @types/mongration
```

## Health

**Score 45/100 (D)** — status: abandoned.

Positive: has types; no vulnerabilities; high maintenance score; popular repo; extremely popular.

Warnings: low downloads; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 1.0.9 |
| Published | 2023-11-07 |
| First published | 2018-10-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 4.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51437 |
| Maintainers | types |

## Links

- npm: https://www.npmjs.com/package/@types/mongration
- Repository: https://github.com/DefinitelyTyped/DefinitelyTyped
- Homepage: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/mongration
- npm.io page: https://npm.io/package/@types/mongration

## Dependencies (2)

- [mongodb](https://npm.io/package/mongodb.md) ^4.5.0
- [@types/node](https://npm.io/package/@types/node.md) *

## Recent versions

- 1.0.9 (latest) — 2023-11-07
- 1.0.6 (ts4.1) — 2022-04-24
- 1.0.5 (ts3.6) — 2021-07-26
- 1.0.3 (ts3.2) — 2020-04-24
- 1.0.2 (ts3.0) — 2019-10-03
- 1.0.1 (ts2.8) — 2019-08-07
- 1.0.0 (ts2.3) — 2018-10-18
- 1.0.8 — 2023-10-18
- 1.0.7 — 2023-09-27
- 1.0.4 — 2021-07-08

## README

# Installation
> `npm install --save @types/mongration`

# Summary
This package contains type definitions for mongration (https://github.com/awapps/mongration#readme).

# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/mongration.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/mongration/index.d.ts)
````ts
import { Db } from "mongodb";

export interface DbConfig {
    hosts?: string | undefined;
    db?: string | undefined;
    user?: string | undefined;
    password?: string | undefined;
    mongoUri?: string | undefined;
    migrationCollection: string;
    replicaSet?: string | undefined;
}

export interface MigrationResponse {
    id: string;
    status: "not-run" | "skipped" | "pending" | "ok" | "error" | "rollback" | "rollback-error";
}

export class Migration {
    constructor(dbConfig: DbConfig);
    add: (paths: string | string[]) => void;
    addAllFromPath: (path: string) => void;
    migrate: (doneCb?: (err: Error | null, response: MigrationResponse[]) => void) => void;
}

export interface MigrationStep {
    id: string;
    up: (db: Db, cb: (err?: Error) => void) => void;
    down?: ((db: Db, cb: (err?: Error) => void) => void) | undefined;
}

````

### Additional Details
 * Last updated: Tue, 07 Nov 2023 09:09:39 GMT
 * Dependencies: [@types/node](https://npmjs.com/package/@types/node), [mongodb](https://npmjs.com/package/mongodb)

# Credits
These definitions were written by [Anton Lobashev](https://github.com/soulthreads).

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