1.1.0 • Published 5 years ago

mlab-js v1.1.0

Weekly downloads
4
License
MIT
Repository
github
Last release
5 years ago

mlab-js

Uses mLab's hidden API (probably for good reason) to strictly deploy & remove databases along with adding and removing users to them.

By using this package, you agree that I am not liable for whatever happens to you and your account, in any way shape or form. Read mLab's acceptable use policy and their terms of service

example of use

// refer to test.js for a more in-depth example
const mLab = require('mlab-js')

let lab = new mLab({ name: 'name', password: 'pass' })
lab.Connect().then(async () => {
    let db = await lab.DeployDatabase({ name: 'example', region: 'us-east-1' })
    console.log('URL = ' + db.Meta.uriTemplate)
})

available options

new mLab({
    
    name: 'string',
    // the username of the account

    password: 'string',
    // the password of the account

    Id: null,
    // the id of the account, must be a string
    // if not provided, will be automatically retrieved when connected

    waitEnabled: false,
    // if true, then it will ensure to wait until the db is loaded
    
    waitInterval: 30,
    // the wait interval used when waiting for db to be loaded

    refreshInterval: 60000 * 30
    // the refresh interval for retrieving the csrf token

})

deploying a database

mLab.DeployDatabase({

    name: 'string',
    // the name of the database

    region: 'string',
    // the region of the database to be located in
    // ex. us-east-1

    ignore: false,
    // if true, it will not throw an error if the db already exists.

    // everything below will default to sandbox options
    // no documentation will be given.

    provider: 'AWS',
    
    version: '3.6.8',

    plan: 'aws-sandbox-v2'

})

adding a user

mBase.addUser({
    
    // self explanatory
    name: 'string',
    password: 'string',

    ignore: false,
    // if true, will not throw an error if the user already exists

})
1.1.0

5 years ago

1.0.9

6 years ago

1.0.8

6 years ago

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago