let rethinkdbConfig = {
  host: process.env.RETHINKDB_HOST || 'localhost',
  port: process.env.RETHINKDB_PORT || 28015,
  db:   'quill_lessons'
}

if (process.env.RETHINKDB_USER) {
  rethinkdbConfig['user'] = process.env.RETHINKDB_USER
}

if (process.env.RETHINKDB_PASSWORD) {
  rethinkdbConfig['password'] = process.env.RETHINKDB_PASSWORD
}

export default rethinkdbConfig

@@ -1,10 +1,12 @@
-le
+cons
 t rethin
@@ -17,18 +17,44 @@
 onfig = 
-%7B%0A
+(() =%3E %7B%0A  let config = %7B%0A  
   host: 
@@ -96,16 +96,18 @@
 lhost',%0A
+  
   port: 
@@ -143,16 +143,18 @@
  28015,%0A
+  
   db:   
@@ -169,19 +169,23 @@
 essons'%0A
+  
 %7D%0A%0A
+  
 if (proc
@@ -208,34 +208,27 @@
 B_USER) %7B%0A  
-rethinkdbC
+  c
 onfig%5B'user'
@@ -258,19 +258,23 @@
 DB_USER%0A
+  
 %7D%0A%0A
+  
 if (proc
@@ -305,26 +305,19 @@
 RD) %7B%0A  
-rethinkdbC
+  c
 onfig%5B'p
@@ -359,17 +359,41 @@
 ASSWORD%0A
-%7D
+  %7D%0A%0A  return config%0A%7D)()
 %0A%0Aexport

Use module pattern because its javascript