open-index/open-npm huggingface dataset:
npm package: @haoc-labs/mygreat
Description: Agnostic migration tool
Latest version: 1.0.2

# mygreat

Agnostic migration tool


## Usage

**Structure:**

```txt
- /
  - migrations/
    - 20171001190100.js
    - 20171001190200.js
  - remote-synced-sample/
  - .mygreat.js
```

**Migration file example:**

```js
'use strict'

module.exports = {
    up: async (db) => { },
    down: async (db) => { }
}
```


**`.mygreat.js` configuration file sample:**

```js
'use strict'

const Database = require('some-database')
const directory = require('@haoc-labs/mygreat-directory')

module.exports = (env) => ({
    local: directory('./migrations'),
    remote: directory('./remote-synced-sample'),
    setup: () => new Database('localhost')
})
```
npm package: @haoc-labs/mygreat-directory
Description: MyGreat filesystem directory based adaptor
Latest version: 1.0.0

# mygreat-directory

```js
const mygreat = require('@haoc-labs/mygreat')
const directory = require('@haoc-labs/mygreat-directory')
const memory = require('@haoc-labs/mygreat/adaptors/in-memory')

const migrate = mygreat.from(directory('./migrations'), memory([]))

;(async () => {
    await migrate.up()
})()
```
npm package: @haoc-labs/mygreat-mongodb
Description: MyGreat mongodb adaptor
Latest version: 1.0.0

# mygreat-mongodb

```js
const directory = require('@haoc-labs/mygreat-directory')
const mongodb = require('@haoc-labs/mygreat-mongodb')
const mongoose = require('mongoose')
mongoose.Promise = Promise

module.exports = (environment) => {
  const conn = mongoose.createConnection('mongodb://localhost:27017/foobar')
  return {
    local: directory('./migrations'),
    remote: mongodb(conn),
    setup: async () => conn,
    shutdown: async () => { mongoose.disconnect() }
  }
}
```