khamba
Version:
A cli tool for sharing files through local network.
16 lines (15 loc) • 464 B
JavaScript
import { atom, map } from 'nanostores';
import { v4 as uuidv4 } from 'uuid';
import { getFreePort } from '../functions/freePort.js';
export const $baseInfo = map({
MY_ID: uuidv4(),
MY_IP: null,
MY_NAME: null,
BROADCAST_ADDR: null,
UDP_PORT: 8008,
HTTP_PORT: (await getFreePort()) ?? 8779,
});
export const $action = atom('NOTHING');
export const $isDev = atom(false);
export const $errorMsg = atom();
export const $sendingFiles = atom({});