It's already there. There are several libraries such as "nostr-tools", "NDK", "nostrify", "nostr-sdk" javascript binding from rust, and many more ..
Discussion
thank you so much for the fast answer, and the options out there! i’ll definitely look into that.
Also https://jsr.io/@blowater/nostr-sdk if you are using Deno
All of them have different flavors