UNPKG
camo
Version:
latest (0.12.5)
0.12.5
0.12.4
0.12.3
0.12.2
0.12.1
0.12.0
0.11.4
0.11.3
0.11.2
0.11.1
0.11.0
0.10.0
0.9.1
0.9.0
0.8.0
0.7.1
0.7.0
0.6.0
0.5.7
0.5.6
0.5.5
0.5.4
0.5.3
0.5.2
0.5.0
0.4.0
0.3.2
0.3.1
0.3.0
0.2.1
0.1.1
0.0.1
A class-based ES6 ODM for Mongo-like databases.
github.com/scottwrobinson/camo
scottwrobinson/camo
camo
/
lib
/
clients
/
index.js
13 lines
(11 loc)
•
317 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
13
'use strict'
;
const
assertConnected =
function
(
db
) {
if
(db ===
null
|| db ===
undefined
) {
throw
new
Error
(
'You must first call \'connect\' before loading/saving documents.'
); } };
exports
.
getClient
=
function
(
) {
const
client =
global
.
CLIENT
;
assertConnected
(client);
return
client; };