Compare commits

...

1 Commits

Author SHA1 Message Date
fiatjaf
8edcea2ed3 fix buffer import and use rollup for transpiling the package. 2021-12-11 08:01:03 -03:00
6 changed files with 35 additions and 3 deletions

View File

@@ -1,3 +1,4 @@
import Buffer from 'buffer'
import * as secp256k1 from '@noble/secp256k1'
import {sha256} from './utils'

View File

@@ -21,3 +21,5 @@ export {
getPublicKey,
getBlankEvent
}
export * from './nip04'
export * from './nip05'

View File

@@ -1,3 +1,4 @@
import Buffer from 'buffer'
import * as secp256k1 from '@noble/secp256k1'
export function encrypt(privkey, pubkey, text) {

View File

@@ -1,3 +1,4 @@
import Buffer from 'buffer'
import dnsPacket from 'dns-packet'
const dohProviders = [

View File

@@ -1,8 +1,10 @@
{
"name": "nostr-tools",
"version": "0.6.0",
"version": "0.6.2",
"description": "Tools for making a Nostr client.",
"main": "index.js",
"main": "dist/nostr-tools.esm.min.js",
"module": "dist/nostr-tools.esm.min.js",
"browser": "dist/nostr-tools.umd.min.js",
"repository": {
"type": "git",
"url": "https://github.com/fiatjaf/nostr-tools.git"
@@ -24,5 +26,14 @@
"censorship",
"censorship-resistance",
"client"
]
],
"devDependencies": {
"rollup": "^2.61.1"
},
"files": [
"dist"
],
"scripts": {
"prepublish": "rollup -c"
}
}

16
rollup.config.js Normal file
View File

@@ -0,0 +1,16 @@
import pkg from './package.json'
export default {
input: 'index.js',
output: [
{
name: 'nostrtools',
file: pkg.browser,
format: 'umd'
},
{
file: pkg.module,
format: 'es'
}
]
}