kenote-mount
v1.0.1
Published
mount the directory into an alias
Downloads
6
Readme
kenote-mount
mount the directory into an alias
Install
npm install --save kenote-mount
Usage
// mounts
const path = require('path')
const { mounts } = require('kenote-mount')
const { userProxy, bookProxy } = mounts(path.resolve(__dirname, 'proxys'), 'Proxy')
userProxy.login(...)
bookProxy.find(...)
// loadModel
const mongoose = require('mongoose')
const MongooseDao = require('mongoosedao')
const { loadModel } = require('kenote-mount')
const Schema = mongoose.Schema
function getMongooseDao (definition, name) {
let schema = new Schema(definition)
let model = mongoose.model(name, schema)
return new MongooseDao(model)
}
module.exports = loadModel(__dirname, getMongooseDao)
License
this repo is released under the MIT License.