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

@synonymdev/slashtag

Package Overview
Dependencies
Maintainers
7
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@synonymdev/slashtag

Identity, discovery, and p2p communication for Slashtags protocol.

  • 1.0.0-alpha.28
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
7
Created
Source

Slashtag

Slashtag is the identity layer of Slashtags protocol, that enables attaching metadata to a keypair (through Hyperdrives), and p2p communications between peers.

This module creates a node that manages a Slashtag's drives, and facilitating p2p connections between slashtags.

Installation

npm install @synonymdev/slashtag

Usage

Quick example showing how to create a Slashtag node and use it to create resolvable public profile.

NOTE: you do NOT need to wait for ready as all internals await this themselves.

import Slashtag from '@synonymdev/slashtag';

const alice = new Slashtag();
const bob = new Slashtag();

await alice.listen() // listen on alice's public key
await bob.connect(alice.key).opened

API

slashtag.url

A SlashURL string in the form slash:<z-base-32 key>.

slashtag.drivestore

Drivestore instance for this slashtag.

await slashtag.listen()

Listen on the slashtag's public key through Hyperswarm DHT p2p server

const socket = slashtag.connect(destination)

Connect to a Slashtag's server. destination is the peer's public key, as a Buffer/Uint8Array, or encoded as a z-base-32 or slash: url.

Returns a promise of Encrypted Connection.

You can await socket.opened.

await slashtag.close()

Destroys the Hyperswarm node, and closes the Corestore instance.

`slashtag.on('connection', (socket) => {})

Emitted whenever the dht recieves a connection as a server or client.

socket is an end-to-end NoiseSecretStream

FAQs

Package last updated on 03 Jul 2023

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