JSPM

nostr-ld

0.0.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1
  • Score
    100M100P100Q25011F
  • License MIT

nostr-ld

Package Exports

    This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (nostr-ld) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    Readme

    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

    • 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

    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

    • MIT