lemon on Nostr: I’m not familiar with typescript so I just kept struggling and stumbling through it ...
I’m not familiar with typescript so I just kept struggling and stumbling through it
Here’s what I eventually did and maybe you can tell me if there was an easier way
-Created a typescript project folder
-npm installed your library
-Created a file to export each function I needed (see image below)
-Packaged it into a webpack
-npm run build to get bundle.js file
-Host bundle.js on cloudflare
Now my webapp has your functions and all I need in my HTML is:
“<script src="
https://cashubuddy.pages.dev/bundle.js"></script>”
Published at
2025-02-18 06:37:02Event JSON
{
"id": "481cafece0dc3dfbb47773d71c84e476c9a049bbfc78a4604d73a7fdeb1b2af2",
"pubkey": "be7358c4fe50148cccafc02ea205d80145e253889aa3958daafa8637047c840e",
"created_at": 1739860622,
"kind": 1,
"tags": [
[
"e",
"3dd23abed6cad9b7b33a9d52eb257123cd7fab4634639a34a1bf32c11f3d1fdc",
"",
"root"
],
[
"e",
"8b61e93c09c56f93f0bc66cf3404fbc92efb561eafbf63070bba33e4fb3417f7",
"wss://e.nos.lol/",
"reply"
],
[
"p",
"ddf03aca85ade039e6742d5bef3df352df199d0d31e22b9858e7eda85cb3bbbe"
]
],
"content": "I’m not familiar with typescript so I just kept struggling and stumbling through it\n\nHere’s what I eventually did and maybe you can tell me if there was an easier way\n\n-Created a typescript project folder\n-npm installed your library\n-Created a file to export each function I needed (see image below)\n-Packaged it into a webpack\n-npm run build to get bundle.js file\n-Host bundle.js on cloudflare \n\nNow my webapp has your functions and all I need in my HTML is:\n“\u003cscript src=\"https://cashubuddy.pages.dev/bundle.js\"\u003e\u003c/script\u003e”\n\nhttps://m.primal.net/PBLr.png",
"sig": "ecfc9bf373b7f64ca5cbb49c2420fdeca19e4f3e013b1446733069b37cc764746a22024bdc7c76a3af0bc597d6a04fe3f7211d06a5fccaf99822729b2c2db036"
}