mirror of
https://github.com/nbd-wtf/nostr-tools.git
synced 2025-12-08 16:28:49 +00:00
remove websocket-polyfill, instruct nodejs users to install it manually.
This commit is contained in:
13
README.md
13
README.md
@@ -2,6 +2,8 @@
|
||||
|
||||
Tools for developing [Nostr](https://github.com/fiatjaf/nostr) clients.
|
||||
|
||||
Very lean on dependencies.
|
||||
|
||||
## Usage
|
||||
|
||||
### Generating a private key and a public key
|
||||
@@ -112,6 +114,12 @@ pub.on('failed', reason => {
|
||||
await relay.close()
|
||||
```
|
||||
|
||||
To use this on Node.js you first must install `websocket-polyfill` and import it:
|
||||
|
||||
```js
|
||||
import 'websocket-polyfill'
|
||||
```
|
||||
|
||||
### Querying profile data from a NIP-05 address
|
||||
|
||||
```js
|
||||
@@ -122,8 +130,11 @@ console.log(profile.pubkey)
|
||||
// prints: 32e1827635450ebb3c5a7d12c1f8e7b2b514439ac10a67eef3d9fd9c5c68e245
|
||||
console.log(profile.relays)
|
||||
// prints: [wss://relay.damus.io]
|
||||
```
|
||||
|
||||
// on nodejs, install node-fetch@2 and call this first:
|
||||
To use this on Node.js you first must install `node-fetch@2` and call something like this:
|
||||
|
||||
```js
|
||||
nip05.useFetchImplementation(require('node-fetch'))
|
||||
```
|
||||
|
||||
|
||||
@@ -14,8 +14,7 @@
|
||||
"@scure/bip32": "^1.1.1",
|
||||
"@scure/bip39": "^1.1.0",
|
||||
"base64-arraybuffer": "^1.0.2",
|
||||
"bech32": "^2.0.0",
|
||||
"websocket-polyfill": "^0.0.3"
|
||||
"bech32": "^2.0.0"
|
||||
},
|
||||
"keywords": [
|
||||
"decentralization",
|
||||
|
||||
Reference in New Issue
Block a user