<commit_before>const PouchDB = require('pouchdb-http')

const env = require('./env')

module.exports = async function () {
  // create /_users if not exists
  const host = env.COUCHDB_URL
  const dbName = '_users'
  const users = new PouchDB(`${host}/${dbName}`)
  return users.info()
}<commit_msg>fix: more reliable db instantiation<commit_after>const { resolve } = require('url')
const PouchDB = require('pouchdb-http')

const env = require('./env')

module.exports = async function () {
  // create /_users if not exists
  const host = env.COUCH_URL
  const dbName = '_users'
  const dbUrl = resolve(host, dbName)
  const users = new PouchDB(dbUrl)
  return users.info()
}
{'fraction_non_alphanumeric': 0.13777777777777778, 'fraction_numerical': 0.0, 'mean_word_length': 4.1603053435114505, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '81979', 'n_tokens_mistral': 222, 'n_tokens_neox': 220, 'n_words': 63}