thesmartwon
thesmartwon
DDeno
Created by thesmartwon on 2/4/2025 in #help
Read dependency directory
Is it possible for a library to read its own non-importable files? I'm publishing some static files in a library. I'd like for that library to copy the files wherever the user wants. Is there a way without transforming those files into importable JSON or JS files? Library:
Deno.statSync(import.meta.resolve("./static").replace("file://", ""));
Deno.statSync(import.meta.resolve("./static").replace("file://", ""));
This works great inside the library. However, outside it will error:
error: Uncaught (in promise) NotFound: No such file or directory (os error 2): stat 'https:/jsr.io/@scope/package/version/static'
Deno.statSync(Deno.statSync(import.meta.resolve("./static").replace("file://", "")););
^
at Object.statSync (ext:deno_fs/30_fs.js:415:3)
...
error: Uncaught (in promise) NotFound: No such file or directory (os error 2): stat 'https:/jsr.io/@scope/package/version/static'
Deno.statSync(Deno.statSync(import.meta.resolve("./static").replace("file://", "")););
^
at Object.statSync (ext:deno_fs/30_fs.js:415:3)
...
3 replies
DDeno
Created by thesmartwon on 11/7/2024 in #help
Install .tar.gz from pkg.pr.new
deno add https://pkg.pr.new/rolldown@02a65e2
error: Failed to parse package required: https://pkg.pr.new/rolldown@02a65e2
deno add https://pkg.pr.new/rolldown@02a65e2
error: Failed to parse package required: https://pkg.pr.new/rolldown@02a65e2
deno install https://pkg.pr.new/rolldown@02a65e2
error: Failed to install "https" specifier.
deno install https://pkg.pr.new/rolldown@02a65e2
error: Failed to install "https" specifier.
Do I have to add pkg.pr.new as a registry? I just want a one-off release before it's pushed to npm.
2 replies