import * as mkdirp from 'mkdirp' ; import { ChronoDB } from '@bitr/chronodb' ; const prodPath = `${ process . cwd ( ) }/datastore/main` ; let chronoDB ; export function getChronoDB ( path = prodPath ) { if ( chronoDB === undefined ) { mkdirp . sync ( path ) ; chronoDB = new ChronoDB ( path ) ; } return chronoDB ; } export async function closeChronoDB ( ) { if ( chronoDB === undefined ) { return ; } await chronoDB . close ( ) ; }