Is there another source to download the bundle.js for nostr-tools?

Parent domain (unpkg.com) is down for the GitHub reference:

https://unpkg.com/nostr-tools/lib/nostr.bundle.js

nostr:nprofile1qyghwumn8ghj7vf5xqhxvdm69e5k7tcpz4mhxue69uhkzet8d9ejuat50phjummwv5hsqgpm7rrrljungc6q0tuh5hj7ue863q73qlheu4vywtzwhx42a7j9n5zgwjy3

#asknostr

Reply to this note

Please Login to reply.

Discussion

That's why I'm having issues....

Glad it's not just me

I walked away for like 40min and came back to nothing working. 🤣🤬🤣

I'm off to bed I guess. Lol.

You could get it from npm (or build it) and serve it from your host

I know that's the right way to do it, but I'm poor with NodeJS and npm and struggle getting standalone builds to work

If I have no luck here, then I'll be forced to learn, I suppose

Unpkg is just a cdn for npm packages, so I looked for another one. Here you go:

https://cdn.jsdelivr.net/npm/nostr-tools/lib/nostr.bundle.js

huh, you shouldnt have to do a 'standalone build' just to have a build. npm run build, npm start? or where are you hosting?

There is no build script in the package json of nostr tools. But it’s still simple enough. Clone the repo, install bun, and run:

$ bun run build.js

$ tsc

(You can probably use node instead of bun)

Then the bundle file will be in the lib folder and you can just serve it with the rest of your app

That’s much easier than what I’ve attempted or read

Thanks for sharing! 🙏

Hadn’t heard of “Bun” before

Forgot to tell you to npm install or bun install before running those commands, but that should be all 🙂

jsdelivr or something.

But you shouldn't download the bundle, you should use npm, import only the specific modules you use then use vite or esbuild to transpile and bundle it locally.

That makes sense

The bundle seems to be 6000+ lines and there’s plenty that I won’t be using

Thanks! 🙏