New:Microsoft Teams Notifications Are Now Available in Socket.Learn more
Get Started

nostr-poster

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

nostr-poster

A simple Nostr posting module with POW and expiration

latest
Source
npmnpm
Version
1.0.2
Version published
Maintainers
1
Created
Source

nostr-poster

A simple Nostr posting module with Proof of Work and optional expiration.

Installation

npm install nostr-poster

Usage

const postToNostr = require('nostr-poster');

  await postToNostr(nsec, content)
    .then((result) => console.log(result))
    .catch((err) => console.error(err));

  await postToNostr(nsec, content, {
    relays: ["wss://custom.relay"],
    powDifficulty: 4,
    expirationDays: 30,
    timeout: 5000,
  }).then((result) => console.log(result));

Features

  • Automatic hashtag (#tag) extraction
  • Link detection and tagging
  • Proof of Work (default difficulty: 3)
  • Optional expiration in days
  • Multiple relay support

Options

  • relays: Array of relay URLs (default: damus.io, purplerelay.com)
  • powDifficulty: POW difficulty level (default: 3)
  • expirationDays: Expiration time in days (optional)
  • timeout: Connection timeout in ms (default: 10000)

Returns

Promise resolving to:

  • { eventId: string } (no expiration)
  • { eventId: string, expirationDate: string } (with expiration)

Keywords

nostr

FAQs

Package last updated on 25 Mar 2025

Related posts