0.0.6 • Published 6 years ago

mojoin-core v0.0.6

Weekly downloads
1
License
ISC
Repository
-
Last release
6 years ago

npm version CircleCI Coverage Status Codacy Badge Maintainability Known Vulnerabilities JavaScript Style Guide: StandardJS License: MIT

mojoin-core

some general description goes here

Quick Start

const Mojoin = require('mojoin-core')
const mojoin = new Mojoin([
  {
    name: 'todos',
    type: 'json',
    location: './node_modules/mojoin-core/examples/datasource/todos.json'
  },
  {
    name: 'users',
    type: 'rest',
    location: 'https://jsonplaceholder.typicode.com/users'
  }
])

const query = {
  table: 'todos',
  where: {
    userId: 2,
    completed: 0
  },
  include: [{
    model: 'users',
    foreignKey: 'userId'
  }]
}

mojoin.syncAll()
  .then(() => mojoin.generateReport(query))
  .then(r => console.log(r))
  .catch(e => console.error(e))

Cache

Default

Specified

type: 'postgres' // 'mysql'|'sqlite'|'postgres'|'mssql',

MongoDB

Protocol: MongoDB

Protocol: SSH

  • privateKey
  • password