UNPKG

@statezero/statezero-tunnel

Version:

Tunnelmole client for StateZero users to create secure tunnels to their local services.

23 lines (17 loc) 432 B
import fs from 'fs'; import { LocalStorage } from 'node-localstorage'; import os from 'os'; let storage: LocalStorage; const initStorage = async () => { const homedir = os.homedir(); const dir = homedir + '/' + '.tmole.sh'; if (!fs.existsSync(dir)){ fs.mkdirSync(dir); } storage = new LocalStorage(dir + '/local-storage'); return; } export { initStorage, storage }