Skip to content

Commit

Permalink
chore: minor fix of docs
Browse files Browse the repository at this point in the history
  • Loading branch information
jiftechnify committed May 14, 2023
1 parent 87533af commit 1b161ca
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
11 changes: 7 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ const postIter = await fetcher.allEventsIterator(
{ kinds: [ eventKind.text ] }
],
/* time range filter (since, until) */
// it is merged into each filter in the array of normal filters above.
{ since: nHoursAgo(24) },
/* fetch options (optional) */
{ skipVerification: true }
Expand All @@ -57,8 +58,9 @@ const allPosts = await fetcher.fetchAllEvents(

// fetches latest 100 text events
// internally:
// fetch latest 100 events from each relay ->
// merge lists of events -> take latest 100 events
// 1. fetch latest 100 events from each relay
// 2. merge lists of events
// 3. take latest 100 events
const latestPosts = await fetcher.fetchLatestEvents(
relayUrls,
/* filters */
Expand All @@ -71,7 +73,8 @@ const latestPosts = await fetcher.fetchLatestEvents(

// fetches the last metadata event published by pubkey "deadbeef..."
// internally:
// fetch the last event from each relay -> take the latest one
// 1. fetch the last event from each relay
// 2. take the latest one
const lastMetadata = await fetcher.fetchLastEvent(
relayUrls,
/* filters */
Expand All @@ -80,7 +83,7 @@ const lastMetadata = await fetcher.fetchLastEvent(
],
)
```
### Working with `nostr-tools`
### Working with [nostr-tools](https://github.com/nbd-wtf/nostr-tools)

First, install the adapter package.

Expand Down
2 changes: 1 addition & 1 deletion scripts/runExample.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as cp from "child_process";

if (process.argv.length <= 2) {
console.error("usage: yarn example <EXAMPLE-NAME> [EXAMPLE-ARGS]...");
console.error("usage: npm run example <EXAMPLE-NAME> [EXAMPLE-ARGS]...");
process.exit(1);
}

Expand Down

0 comments on commit 1b161ca

Please sign in to comment.