UNPKG

linky

Version:

Easily retrieve your Linky power consumption

19 lines (18 loc) 407 B
import Conf from 'conf'; import { pkg } from './pkg.js'; const TOKEN = 'token'; const store = new Conf({ projectName: 'linky', projectVersion: pkg.version, migrations: { '>=2.0.0': (store) => { store.clear(); }, }, }); export function getToken() { return store.get(TOKEN, undefined); } export function saveToken(token) { return store.set(TOKEN, token); }