New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@snort/system

Package Overview
Dependencies
Maintainers
0
Versions
62
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@snort/system

Snort nostr system package

  • 1.6.1
  • latest
  • npm
  • Socket score

Version published
Maintainers
0
Created
Source

@snort/system

A collection of caching and querying techniquies used by https://snort.social to serve all content from the nostr protocol.

Simple example:

import { NostrSystem, RequestBuilder, StoreSnapshot, NoteCollection } from "@snort/system";

// Singleton instance to store all connections and access query fetching system
const System = new NostrSystem({});

(async () => {
  // Setup cache system
  await System.Init();

  // connec to one "bootstrap" relay to pull profiles/relay lists from
  // also used as a fallback relay when gossip model doesnt know which relays to pick, or "authors" are not provided in the request
  await System.ConnectToRelay("wss://relay.snort.social", { read: true, write: false });

  // ID should be unique to the use case, this is important as all data fetched from this ID will be merged into the same NoteStore
  const rb = new RequestBuilder("get-posts");
  rb.withFilter()
    .authors(["63fe6318dc58583cfe16810f86dd09e18bfd76aabc24a0081ce2856f330504ed"]) // Kieran pubkey
    .kinds([1])
    .limit(10);

  const q = System.Query(rb);
  // basic usage using "onEvent", fired every 100ms
  q.on("event", evs => {
    console.log(evs);
    // something else..
  });
})();

FAQs

Package last updated on 26 Dec 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc