Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@synonymdev/feeds

Package Overview
Dependencies
Maintainers
10
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@synonymdev/feeds

A library for creating and managing feeds using Hyperdrive and Hyperswarm.

  • 1.0.0-alpha.3
  • npm
  • Socket score

Version published
Maintainers
10
Created
Source

Slashtags Feeds

A library for creating and managing feeds using Hyperdrive and Hyperswarm.

Usage

Initiate the library.

const feeds = new Feeds();
const feedID = feeds.randomID();
await feeds.update(feedID, 'balance', 1000);

API

const feeds = new Feeds(storage, [opts])

Create a Feeds instance.

storage Storage directory to save feeds at. Defaults to os.homedir() + '/.slashtags-feeds/'

opts includes:

  • metadata: an object of metadata files to be saved along the data. example { schema: schema }
feeds.randomID()

Generate a random string id to be used as the feedID.

await feeds.feed(feedID)

Returns the feed key and encryptionKey for a given feed, identified by any serializable id. It awaits until the feed is announced on the swarm.

await feeds.update(feedID, key, value)

Updates a feed. key is a string, and value is a serializable JSON object.

await feeds.get(feedID, key)

Returns a value from a feed.

await feeds.close()

Gracefully closing feeds and freeing IO resources.

await feeds.destroy(feedID)

Destroys all stored data for the feed.

How it works

As of this first version, Slashtags feeds is a directory on top of Hyperdrive with the current structure:

├── feed
│   ├── foo
│   ├── bar
└── slashfeed.json

Where slashfeed.json defines the name, image and other future metadata about the feed. And feed directory contains the feed files, where each file represents a key value pair.

FAQs

Package last updated on 24 Oct 2022

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