Bustin Base
Bustin Base
DDeno
Created by Bustin Base on 2/18/2024 in #help
How can I do server sent events on the client side in deno?
I have a server api which is doing server sent events correctly, I can see it in curl doing what I would expect. One the calling side I have a simple cli written in deno and I'm trying to use an EventSource, which is not a requirement. If there is an easier way I'm all for it. The downside of the EventSource is that it is an event handler api, where you subscribe to on('message', handler) and I'm looking for an async generator api. If I just use the EventSource as is, it appears to not work at all, the process just exits right away as if its not taking out a ref(). If I convert it into an async generator then I"m getting a "Top-level await promise never resolved" error. I'm wondering if anyone has any simple examples of doing server sent events in deno client side? Using EventSource is not required at all.
5 replies
DDeno
Created by Bustin Base on 7/20/2023 in #help
Petition to free the module x/type from deno.land
Here is the module url: https://deno.land/x/type It says it would be deleted after 30 days but has nothing published to it. Can it be freed?
30 replies
DDeno
Created by Bustin Base on 7/16/2023 in #help
FakeTime seems to break async tests
I am attempting to use FakeTime similarly to in the Faking time example of https://deno.land/manual@v1.35.1/basics/testing/mocking But whenever I run the tests it responds with:
error: Promise resolution is still pending but the event loop has already resolved"
The test partially runs but it seems to reach a point where it calls setTimeout and then just exits. If I remove the reference to fake time then the test runs as expected, it just takes a little more time. Does anyone have any experience with using FakeTime in an asynchronous test? The function its getting hung up on is the std library retry function.
1 replies
DDeno
Created by Bustin Base on 6/25/2023 in #help
What is the right way to bundle native modules?
If I'm not able to import a native module with the built-in "import" keyword, what is the ideal way to download and cache them? Should I be fetching it? How should I be caching it locally? Should I make an "install" script? What are the general techniques, does anyone have any examples?
6 replies
DDeno
Created by Bustin Base on 4/29/2023 in #help
Does anyone have a working OpenCL deno example?
How can I use opencl with deno? Any examples?
1 replies
DDeno
Created by Bustin Base on 4/13/2023 in #help
Is there a way to vendor npm specifier imports?
deno vendor npm:express Vendored 0 modules into scripts/vendor directory
6 replies
DDeno
Created by Bustin Base on 4/13/2023 in #help
How can I import with npm: specifiers through a proxy?
My company blocks npmjs.com and they have setup an internal Artifactory instance. With nodejs I can just setup a .npmrc file with a _registry entry and npm will continue to work. Will deno repsect the .npmrc file or is there another way to configure the registry url?
2 replies