Skip to content
forked from akiomik/nosvelte

An experimental Svelte library for building Nostr apps easily

License

Notifications You must be signed in to change notification settings

zatzby/nosvelte

This branch is 1 commit ahead of, 8 commits behind akiomik/nosvelte:main.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

23dc0b2 · Aug 7, 2024
Jun 15, 2023
Jul 18, 2023
Jun 4, 2023
Jun 4, 2023
Jun 5, 2023
Jun 4, 2023
Jun 4, 2023
Jun 4, 2023
Jun 4, 2023
Jun 5, 2023
Aug 11, 2023
Jun 21, 2024
Jul 18, 2023
Jun 4, 2023
Jun 4, 2023
Jun 15, 2023

Repository files navigation

nosvelte

npm version Node.js CI

An experimental Svelte library for building Nostr apps easily. Highly inspired by sveltefire.

<script lang="ts">
  import { Metadata, NostrApp, Text } from 'nosvelte';

  const relays = ['wss://relay.damus.io', 'wss://relay.snort.social'];
  const id = 'b6cf76789bd25d11eafa65d28c16dd640056919f703191aa06619c5b21f732e3';
</script>

<NostrApp {relays}>
  <Text queryKey={[id]} {id} let:text>
    <Metadata queryKey={['metadata', text.pubkey]} pubkey={text.pubkey} let:metadata>
      <!-- Shows "jack: Japan confirmed punk" -->
      <p>{JSON.parse(metadata.content).name}: {text.content}</p>
    </Metadata>
  </Text>
</NostrApp>

Features

  • Zero-configuration
  • Svelte stores and components to use Nostr events
  • Caching requests

Installation

npm install nosvelte

Exapmles

You can see some example codes in src/routes.

About

An experimental Svelte library for building Nostr apps easily

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Svelte 54.9%
  • TypeScript 41.8%
  • JavaScript 2.7%
  • HTML 0.6%