nostr-ld
v0.0.1
Published
nostr-ld
Downloads
2
Readme
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
- Event-LD: Transforms Nostr events into JSON-LD format.
- Profile-LD: Transforms Nostr profiles into JSON-LD format.
- Easy extensibility to support additional Nostr types in the future.
- Promotes decentralization and domain independence.
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:
- Interoperability: JSON-LD is a W3C standard widely adopted, which enables data from Nostr to be easily consumed by a broad range of tools and applications.
- Decentralization: By storing data in a decentralized manner, in the
/.well-known/nostr/
directory, Nostr-LD helps to maintain the decentralized nature of Nostr and doesn't put pressure on individual relays. - Semantic Web: JSON-LD is a key technology in the Semantic Web, enabling Nostr data to be part of the larger web of data.
Contributing
We welcome contributions! Please see our contributing guide for more details.
License
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
- MIT