UNPKG

lowkie

Version:

My Custom lowkie / Express Applcation

100 lines (80 loc) 2.72 kB
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>JSDoc: Source: lowkieClass.js</title> <script src="scripts/prettify/prettify.js"> </script> <script src="scripts/prettify/lang-css.js"> </script> <!--[if lt IE 9]> <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script> <![endif]--> <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css"> <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css"> </head> <body> <div id="main"> <h1 class="page-title">Source: lowkieClass.js</h1> <section> <article> <pre class="prettyprint source linenums"><code>'use strict'; const events = require('events'); const lowkieSchema = require('./schema'); const lowkieModel = require('./model'); const lowkieConnect = require('./connect'); const lowkieProxyHandler = require('./lowkieProxyHandler'); /** * lowkie ORM singleton class * * @class lowkie */ class lowkie { /** * Creates an instance of lowkie. * @param {any} [options={}] * * @memberOf lowkie */ constructor(options = {}) { this.config = Object.assign({ adapterType: 'file', debug: false, strictSchemas: true, overwriteInvalidJSON:true, }, options); this.connections = new Map(); this.db = undefined; this.models = {}; this.connection = new events.EventEmitter(); this.model = lowkieModel.bind(this); this.connect = lowkieConnect.bind(this); this.Schema.Types = lowkieSchema.Types; return new Proxy(this, lowkieProxyHandler.call(this)); } /** * creates lowkie schema, also includes helpers for document validations * * @param {object} scheme * @returns instance of lowkieSchema * * @memberOf lowkie */ Schema(scheme) { return new lowkieSchema(scheme, this); } } module.exports = lowkie; </code></pre> </article> </section> </div> <nav> <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="lowkie.html">lowkie</a></li><li><a href="lowkie.lowkie.html">lowkie</a></li><li><a href="lowkieSchema.html">lowkieSchema</a></li><li><a href="ObjectId.html">ObjectId</a></li></ul><h3>Global</h3><ul><li><a href="global.html#connect">connect</a></li><li><a href="global.html#handler">handler</a></li><li><a href="global.html#model">model</a></li></ul> </nav> <br class="clear"> <footer> Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Mon Mar 27 2017 21:39:17 GMT-0400 (EDT) </footer> <script> prettyPrint(); </script> <script src="scripts/linenumber.js"> </script> </body> </html>