# migrations-engine

> migrations-engine

Latest version **0.1.2** (published 2019-12-14) · LGPL-3.0-only license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install migrations-engine
pnpm add migrations-engine
yarn add migrations-engine
bun add migrations-engine
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 0.1.2 |
| Published | 2019-12-14 |
| First published | 2019-12-13 |
| Weekly downloads | 0 |
| License | LGPL-3.0-only |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 14.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Oleksii Rudenko |
| Maintainers | orkon |

## Links

- npm: https://www.npmjs.com/package/migrations-engine
- npm.io page: https://npm.io/package/migrations-engine

## Recent versions

- 0.1.2 (latest) — 2019-12-14
- 0.1.1 — 2019-12-13
- 0.1.0 — 2019-12-13

## README

<h1 align="center">
  migrations-engine
  <a href="https://www.npmjs.org/package/migrations-engine"><img src="https://img.shields.io/npm/v/migrations-engine.svg?style=flat" alt="npm"></a>
  <a href="https://travis-ci.org/OrKoN/migrations-engine"><img src="https://travis-ci.org/OrKoN/migrations-engine.svg?branch=master" alt="travis"></a>
</h1>

Simple library to manage database migrations in-memory:

- migration must have a name
- migrations are applied in order, by name (using String.localeCompare to order)

```
npm i migrations-engine --save
```

```ts
import { up, down } from 'migrations-engine';

const all = [
  // these are all available migrations
  {
    name: 'A',
  },
  {
    name: 'B',
  },
];

const applied = [
  // these are all applied migrations so far
  {
    name: 'A',
  },
];

const migrationsToApply = up(applied, all); // [{ name: 'B' }]

// apply migrations
```

The storage and applying of migrations is up to you.

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