aibulat.bsky.social
@aibulat.bsky.social
Reposted
Run Rust (left) in JavaScript (right) via wasm

deno.com/blog/intro-t...
February 5, 2025 at 6:25 PM
Reposted
The wasm build tool for using Rust in Deno:
github.com/denoland/was...
GitHub - denoland/wasmbuild: Build tool to use Rust code in Deno and the browser.
Build tool to use Rust code in Deno and the browser. - denoland/wasmbuild
github.com
February 5, 2025 at 6:25 PM
Parcel Image Optimization.

Did you know that Parcel can optimize images for you?

In your html code, you can specify src for img tag:
"image.jpeg?as=avif&width=800"

And it will be automatically converted/resized.

gist.github.com/ngmaibulat/b...
Image Optimization via Parcel
Image Optimization via Parcel. GitHub Gist: instantly share code, notes, and snippets.
gist.github.com
February 4, 2025 at 10:29 AM
TSUP docs says it should automatically mark files to be executables, if we have a hashbang:

tsup.egoist.dev#building-cli...

For some, reason it did not work for me. So I had to use a workaround with `onSuccess` handler:

gist.github.com/ngmaibulat/6...

Using: tsup/8.3.6 linux-x64 node-v23.7.0
tsup
bundle typescript library with ease
tsup.egoist.dev
February 4, 2025 at 10:20 AM
SQLite driver is now included out of box in all 3 major JS runtimes. Although, for complex apps - PostgreSQL would be better of course - for many apps SQLite is actually sufficient.

Examples: simple one node website/webapp, some personal cli tools, node specific caching/logging.
February 4, 2025 at 9:06 AM
Reposted
@jsr.io is now openly governed — meet its board members and check out its governance charter 👇

deno.com/blog/jsr-ope...
Introducing the JSR open governance board
JSR, a modern open source JavaScript registry, is meant for the greater JavaScript and TypeScript community. We're thrilled to announce its own independent governing body.
deno.com
February 3, 2025 at 6:18 PM
All of 3 major runtimes: node, deno, bun have option to load .env files. And support --env-file option to specify the location of env file. That eliminates need to dotenv package for most of uses cases. But not for all uses cases. What is absent - is API to load env files dynamically, at runtime.
February 1, 2025 at 1:34 PM
TSUP docs:

tsup.egoist.dev
tsup
bundle typescript library with ease
tsup.egoist.dev
February 1, 2025 at 6:36 AM
Example config for tsup:

import { defineConfig } from "tsup";

export default defineConfig({
entry: ["src/index.ts", "src/lib.ts"],
format: ["esm"],
outDir: "dist",
dts: false,
splitting: false,
minify: false,
bundle: true,
target: "esnext",
});
February 1, 2025 at 6:33 AM
Started using tsup for building TS libs. Very nice and simple. I also needed to bundle JSON into code during build - that worked fine. TSC or Bun bundler -- would just leave import statement as is. Compile-time env vars can be also used.
February 1, 2025 at 6:31 AM
Reposted
Building a CLI is easy with these browser methods 👀
January 30, 2025 at 6:32 PM
Reposted
Deno 2.1.8 has been released with important LSP performance improvements along with an important bug fix for S3 uploads

github.com/denoland/den...
Release v2.1.8 · denoland/deno
2.1.8 / 2025.01.30 feat(unstable): support https otlp endpoints (#27743) fix(check): better handling of TypeScript in npm packages for type checking (#27853) fix(check): compiler options from work...
github.com
January 30, 2025 at 8:29 PM
Reposted
The OpenAI JavaScript SDK is now on @jsr.io 🎉️

deno.com/blog/openai-...
January 24, 2025 at 4:48 PM
Reposted
Deno 2.1.7 is out!
▸ smaller deno compile binaries (~2Mb)
▸ Node compat bug fixes
Upgrade with `deno upgrade`

github.com/denoland/den...
January 22, 2025 at 9:42 PM
Defer attribute for scripts

I got question why `defer` attribute did not work as expected and script did not see DOM elements. The actual issue was that defer attribute only works for external scripts. It does not work for inline code inside script tag!

developer.mozilla.org/en-US/docs/W...
<script>: The Script element - HTML: HyperText Markup Language | MDN
The <script> HTML element is used to embed executable code or data; this is typically used to embed or refer to JavaScript code. The <script> element can also be used with other languages, such as Web...
developer.mozilla.org
January 23, 2025 at 4:14 AM
Bun 1.2 released

- S3 client
- PostgreSQL client
- node:dgam support

www.youtube.com/watch?v=uSzf...
Bun 1.2
YouTube video by Bun
www.youtube.com
January 23, 2025 at 3:26 AM
Consider a simple table in Google Docs. Copy few adjacent cells into clipboard. Have you ever wondered what exactly the html content would look like? You will not see it by pasting into text editor! As the text editors would paste text/plain part of the clipboard.

gist.github.com/ngmaibulat/b...
Few adjacent cells copied from table in Google Docs
Few adjacent cells copied from table in Google Docs - table.html
gist.github.com
January 20, 2025 at 8:59 AM