#deno
Hey! I'm trying to rewrite my #telegram bot from #nodejs to #deno and struggling with a couple of issues. First of all: does anyone know Deno's alternative of the emitter.once(eventName, listener)?
NodeJs doc for example: https://nodejs.org/api/events.html#emitteronceeventname-listener
#Deno Deploy's new project creation flow has gotten a makeover. It's now much easier to get started with templates like a full-stack Fresh ๐ app.

This simple #Deno KV tutorial will teach you how to use:
๐ secondary indexes
๐ฅ atomic transactions
๐ list and pagination
New #Deno issue that deserves your attention: "First-class support for full-stack web development":
@deno_land
#JavaScript
Did you know that
#deno
is the most starred Rust project on GitHub?
๐ฆ โค๏ธ ๐ฆ
https://github.com/EvanLi/Github-Ranking/blob/master/Top100/Rust.md
I made a little tool to see how many App Store downloads I've had, it's really hard to work out with their app and I want to make a little pi pico dashboard-y thing next!
It was a fun excuse to play around with Deno too.
I think I need to fork (https://github.com/preactjs/preact-render-to-string/issues) [#preact] and get an return value that also includes a list of all elements used, specifically hyphenated web-components. Then I can conditionally add the the #webcomponent dependency to the page. (this is for a #deno project)
cc thoughts @marvinh ?
Announcing Node.js built-ins support in Deno Deploy
Starting today, all Node.js built-in modules like `fs`, `path`, and `http` can be imported and used on #Deno Deploy.
This means: you can now run Node.js programs at the edge. ๐คฏ
โก๏ธ https://deno.com/blog/node-builtins-on-deploy
๐ข ๐ฆ ๐ช
#Deno, the runtime for JavaScript and TypeScript, has released version 1.34 which enhances the developer experience and compatibility with #npm and #NodeJS.
https://alternativeto.net/news/2023/5/deno-1-34-released-with-better-compatiblity-with-npm-and-node-js/
Deno Deploy now supports all 47 Node.js modules using the 'node:' prefix on the import URL.
#deno #nodejs #javascript #edge
https://deno.com/blog/node-builtins-on-deploy
I might or might not just have written a small utility to create password variants for your wordlist. Use it as a seed for your favorite #password cracker;
https://github.com/theimpossibleastronaut/ordbok
It comes with zero warranty, but it is written in #deno #typescript and is free to use.
#Deno 1.34 is here! Top updates:
1๏ธโฃ deno compile supports npm packages
2๏ธโฃ More Node.js APIs supported
3๏ธโฃ Glob support in deno.json
4๏ธโฃ TLS certificates with IP addresses
5๏ธโฃ Language server and config file improvements
Full release notes
Here'a a handy way to discover all the records in a Deno KV data store. You can run it in the #deno repl with the --unstable flag:
@deno_land
TIL with #Deno in order for environmental variables to be loaded from the .env file, you need to make sure you add this import to the file first run in the deno app:
import "https://deno.land/std/dotenv/load.ts";
I'm thinking about how I could a good #cli for #hsml
I may orientate on existing CLIs like #Rust, #deno or #pnpm
so e.g.
```bash
hsml compile # compiles all .hsml files to .html inside current folder and recursive below
hsml compile ./example.hsml # just compiles the given file
hsml fmt # formats
hsml fmt # just formats given file
hsml parse ./example.hsml # parses the given file and std::out as json AST
```
But I'm not sure if this fulfills all need or if I need to change something
Currently #deno vendor didn't works on npm:<pkg> ๐
Just put together some thoughts on my expierence shipping the "Deno Resume" module, check it out #deno "Organizing Files in a Deno Module" https://dev.to/reggi/organizing-files-in-a-deno-module-d63
I've wanted to play with #sqlite's #FTS5 (Full text #search extension) in #Deno for a long time. But this issue may not get resolved (for good reasons):
https://github.com/dyedgreen/deno-sqlite/issues/108
So I forked the repo and made a one-line change to the Makefile and bam! got my FTS.
https://github.com/teleclimber/deno-sqlite/commit/05ce37da26742e6d3b80dc7b92e3b80cbd93689b
So far it seems to work fine. Give it a shot if you like, you can import like this:
import { DB } from "https://github.com/teleclimber/deno-sqlite/raw/master/mod.ts";
I'll publish as a proper module in time if signals are positive.
New #Deno project just dropped ๐, it's a Resume website / pdf builder ๐ช๐๐. Check it out and give me your thoughts!
https://dev.to/reggi/a-deno-resume-website-builder-using-tailwind-1ggp
The #cslnext #csl project (no, I'm not good with project names, and it's likely temporary) has turned out to be pretty fun.
I switched to using #deno for development a couple of weeks ago, and in the past couple of days finally hit a key milestone:
https://github.com/bdarcus/csl-next/commit/ece85826f4141c06d34de877f3c11b6cbad5225d
Will be tagging v0.1.0 in the coming days, which is just me saying the draft model is solid enough to start building out the processing functionality.
@WindmillDev (YC S22), a platform for building enterprise workflows from scripts, chose #Deno for its:
โก๏ธ minimal cold start times
๐ ability to securely run untrusted code
๐ช ease in creating and sharing self-contained scripts
https://deno.com/blog/immutable-scripts-windmill-production-grade-ops
Looks like auth is going to be part of Deno KV! There is a PR to add Deno KV OAuth to deno-saaskit that has been approved by multiple #Deno team members:
@deno_land
Curious about consistency control in #Deno KV? Here's a demo:
Trying to think more and more about creating a service or business that appeals to #Deno developers where the deliverable is a dynamic module url.
One idea is to create a Deno-specific image host, where you upload images to a bucket and in return you get a object with the src, height, width, alt? of the images all ready to be spread over an `img` tag.
import img from "๐๐๐๐๐://๐๐๐.๐๐๐/:๐๐๐๐/:๐๐๐๐๐๐.๐๐""
<img {...img.profile} />
Who would use this? ๐ค
Trying to get better at publishing and packaging my little #Deno projects into their own repos with documentation and or articles. Here's what I made this week ๐ป๐
โ๏ธ๐ฒ Create a static link-list page using tailwind
https://github.com/reggi/anchorarbor
โก๏ธ๐ท๐ช Code Generates Classes using the Linear Builder Class pattern
https://github.com/reggi/linear-builder-class
๐๐ Convert an image (or folder of images) into a json file uses base64
https://github.com/reggi/image-to-json
Let's say you're building a Deno module, and it has some main programmatic functionally under mod.ts.
What should the executable file name of a #Deno module be named?
#code #opensource #cli #terminal #bin #module #programming #package
Still gravitate toward the idea of being able to senselessly import any file type into #Deno, and having custom file interpreters ๐ค. One day ๐ค
The new CsvStringifyStream API transforms the source streaming input into the stream of csv rows:
Kitson Kelly, formerly of the #Deno team has created a utility library kv-toolbox for Deno KV that includes functions for persisting blobs in the KV data store:
@deno_land
I am creating a library using #typescript I would like to generate using the same codebase a valid #deno import, an #javascript #ESM module and #CommonJS module for maximum compatibility. Does anyone have a magic tsconfig configuration in the best case, or any idea about an easy solution to achieve this?
Create a script that generates code from a small definition and scaffolds a class using a "builder pattern" but keeps typescript generics from one method to the next intact! #typescript #deno #oop #programming #code #coding โก๏ธ๐ท๐ช
https://github.com/reggi/linear-builder-class
#Deno 1.33.3 contains experimental support for npm modules with "deno compile"
Is this something you would use?
Build your own ChatGPT-style doc search with Fresh ๐, Supabase, OpenAI
https://deno.com/blog/build-chatgpt-doc-search-with-supabase-fresh
Tinkering today with a server where you write TSX / JSX and get a single endpoint that can serve just the plain HTML in different ways. For example you can do .htmlwc or .js and get the web component in either HTML format or JS format. Lots of interesting ideas here. #deno #htmx #html #server #webdev #overthewire #webcomponent #webcomponents
https://gist.github.com/reggi/2a49b47d367a31ceb37280f11579825c
One common misconception I'm always confronted with is that people think #Deno is actually executing TypeScript. It's not. It's transpiling TypeScript in a pre-step and then executes JavaScript. When you run e.g. a server you don't really see the difference, but it can add substantial cost to your execution time if have arbitrary workloads.
@boneskull Doesn't #Deno run TypeScript out of the box? https://deno.com/runtime
Example showing how to create a SPA in #Deno Fresh using a hidden island element so that all content is dynamic in the browser:
#denofresh
Got to the point where #Dropserver can package an app.
I was immediately struck by the package size for an app I'm working on:
59Kb
The app (a shopping list tracking thing) is quite functional and the package includes all the frontend and some of the backend (#Deno will fetch necessary remote modules which will increase the on-disk size).
An archive that small is trivial to host (on S3, Netlify, whatever) so that other users may install the app on their own Dropserver instance.
1/

I am rooting hard for #deno, but it is the third time this week that I need to stop a project because some kind of bug :(
Hot take, all servers should be a function that have the shape (req: Request) => Response. #deno
Pagination in #Deno KV:
https://twitter.com/deno_land/status/1656008979426811920?s=20
fastwebsockets, https://github.com/denoland/fastwebsockets.
fastwebsockets is a fast WebSocket protocol implementation.
It passes the Autobahn|TestSuite and is fuzzed with LLVM's libfuzzer.
It can be used as a raw WebSocket frame parser, or as a full-fledged WebSocket client/server.
`Deno.serve()` got faster in #Deno 1.33.
As we get closer to stabilizing this API, we are also rebuilding it around Hyper 1.0, which comes with a 60% bump in request-handling throughput: