nostr-ld

nostr-ld

nostr-ld

Documentation


GitHub license npm npm Github Stars

Nostr-LD

Nostr-LD is a powerful and extensible library for transforming Nostr events and profiles into JSON-LD format. By leveraging JSON-LD, a W3C standard, Nostr-LD allows Nostr data to be interpreted and used by a wide range of tools and applications, enhancing interoperability and integration across the web.

Table of Contents

Features

Installation

npm install nostr-ld

Usage

Event-LD

import { eventld } from 'nostr-ld';

const event = '{...}'; // Your Nostr event here.
const jsonLD = eventld(event);

console.log(JSON.stringify(jsonLD, null, 2));

Profile-LD

import { profileld } from 'nostr-ld';

const user = '...'; // Your user pubkey here.
const mergedData = '{...}'; // Merged user data.
const jsonLD = profileld(user, mergedData);

console.log(JSON.stringify(jsonLD, null, 2));

Why Nostr-LD?

The adoption of JSON-LD for Nostr events and profiles brings several benefits:

Contributing

We welcome contributions! Please see our contributing guide for more details.

License

MIT


By embracing standards like JSON-LD, Nostr-LD aims to keep Nostr open, interoperable, and ready for the future of the web. We hope you find this library useful in your Nostr-related projects.

License