argon.js is a miniature relay, in the way tinyrelay is a big one: an IndexedDB event store that understands replaceable, addressable, ephemeral and deletion events. Loaded alongside xenon.js, it answers every subscription from the cache first and stores every event that arrives or is published. Pages render instantly on reload and keep working offline.
<script src="argon.js"></script>
<script src="xenon.js"></script>
<ol nxe-filter='{"kinds":[1],"limit":50}'></ol>
On reload the list fills from IndexedDB before any relay answers, and xenon drops the duplicates when they arrive.
| attribute | description |
|---|---|
nar-ignore |
Neither read from nor write to the cache for subscriptions on or under this element |
window.narCfg = {name} picks the database name (default argon).
from == "argon", then an nxe:eose with from == "argon".d tag.e tags.| function | returns |
|---|---|
argon.put(event) |
true if stored |
argon.query(filters) |
matching events, newest first, honoring each filter's limit |
argon.match(filter, event) |
NIP-01 filter test |
argon.remove(id?) |
removes one record, or everything |
argon.js (2.5/1.0kb raw/brotli), prefix nar-