nostr-tools 1.5.0 → 1.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -120,7 +120,7 @@ let event = await relay.get({
120
120
  ids: ['44e1827635450ebb3c5a7d12c1f8e7b2b514439ac10a67eef3d9fd9c5c68e245']
121
121
  })
122
122
 
123
- await relay.close()
123
+ relay.close()
124
124
  ```
125
125
 
126
126
  To use this on Node.js you first must install `websocket-polyfill` and import it:
package/build.js CHANGED
@@ -1,5 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
 
3
+ const fs = require('fs')
3
4
  const esbuild = require('esbuild')
4
5
 
5
6
  let common = {
@@ -11,11 +12,16 @@ let common = {
11
12
  esbuild
12
13
  .build({
13
14
  ...common,
14
- outfile: 'lib/nostr.esm.js',
15
+ outfile: 'lib/esm/nostr.mjs',
15
16
  format: 'esm',
16
17
  packages: 'external'
17
18
  })
18
- .then(() => console.log('esm build success.'))
19
+ .then(() => {
20
+ const packageJson = JSON.stringify({ type: 'module' })
21
+ fs.writeFileSync(`${__dirname}/lib/esm/package.json`, packageJson, 'utf8')
22
+
23
+ console.log('esm build success.')
24
+ })
19
25
 
20
26
  esbuild
21
27
  .build({