UNPKG

wett

Version:

wett is a api layer between user api and db. provinding inbuilt user authentication via jwt and a db layer module to easily use multiple db with common functions

47 lines (37 loc) 893 B
"use strict"; const uniqid = require('uniqid'); const common = require('./common'); const log = true; let pool = {}; let loggy = {}; module.exports = { init : function(doLog){ common.tell('map initiated',log); let mapId = uniqid(); pool[mapId] = []; if(doLog = true){ loggy[mapId] } return mapId; }, tell : function(id,string){ common.tell('info mapped',log); let yolo = '+++ ' + string; pool[id].push(yolo); }, warn : function(id,string){ common.tell('warning mapped',log); let yolo = '??? ' + string; pool[id].push(yolo); }, error : function(id,string){ common.tell('error mapped',log); let yolo = '!!! ' + string; pool[id].push(yolo); }, flush : function(id){ common.tell('map flushed',log); console.log(pool[id]); delete pool[id]; } };