How to rewrite this: `import * as base32 from "jsr:@std/encoding@0.224.3/base32.ts";`

I am migrating std from /x and I ran into this issue. What the correct way to import just base32.ts. For now I can do https://jsr.io/@std/encoding/0.224.3/base32.ts
4 Replies
Leokuma
Leokuma4w ago
From https://jsr.io/@std/encoding@0.224.3/doc/base32/~:
import * as base32 from "jsr:@std/encoding@0.224.3/base32"
import * as base32 from "jsr:@std/encoding@0.224.3/base32"
Exports are declared in deno.json: https://jsr.io/@std/encoding/0.224.3/deno.json
@std/encoding - JSR
@std/encoding on JSR: Utilities for encoding and decoding common formats like hex, base64, and varint
cococore
cococore3w ago
why do you migrating? does jsr better than x?
iuioiua
iuioiua3w ago
Yes, JSR is better than /x. This blog post can provide more context behind the decision: https://deno.com/blog/std-on-jsr
Deno Blog
The Deno Standard Library is now available on JSR
The Deno Standard Library has moved to JSR, supporting SemVer ranges in imports and compatibility with Node.js, Cloudflare Workers, and more.
Leokuma
Leokuma3w ago
Deno team is really pushing JSR, but personally I would not say JSR is "better" than HTTPS. I'd say it depends on your use case and the way you like to work. There are tradeoffs