SwarmConfig
@totemsdk/pear / SwarmConfig
Interface: SwarmConfig
@totemsdk/pear — Config loading utilities
loadConfig reads app configuration in the following order:
globalThis.Pear.config— structured data injected by the Pear runtime when the app is launched from a Pear link (pear:/// ). This is the authoritative Pear config source; no additional network call is made. pear://config/<appName>— conventional key name checked insideglobalThis.Pear.storage(Pear's local app KV store) when the Pear runtime is present butPear.configdoes not carry the app config.configPath(file on disk, JSON) — explicit override for non-Pear environments (Node.js scripts, local dev server, Bare without Pear).- Empty default config
{ appName }.
defaultSwarmConfig() returns safe defaults for Hyperswarm join options.
Bare-compatible: no process.env, no __dirname, no require.
Properties
client
client:
boolean
maxPeers
maxPeers:
number
server
server:
boolean
timeoutMs
timeoutMs:
number