JavaScript's New Superpower: Explicit Resource Management

This page summarizes the projects mentioned and recommended in the original post on news.ycombinator.com

SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com
featured
  1. proposal-explicit-resource-management

    ECMAScript Explicit Resource Management

    > This looks most similar to golang’s defer. It runs cleanup code when leaving the current scope.

    It's nothing like go's defer: Go's defer is function-scoped and registers a callback, using is block-scoped and registers an object with a well defined protocol.

    > It differs from [...] c# “using,”

    It's pretty much a direct copy of C#'s `using` declaration (as opposed to the using statement): https://learn.microsoft.com/en-us/dotnet/csharp/language-ref....

    This can also be seen from the proposal itself (https://github.com/tc39/proposal-explicit-resource-managemen...) which cites C#'s using statement and declaration, Java's try-with-resource, and Python's context managers as prior art, but only mentions Go's defer as something you can emulate via DisposableStack and AsyncDisposableStack (types which are specifically inspired by Python's ExitStack),

  2. SaaSHub

    SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives

    SaaSHub logo
  3. > This looks most similar to golang’s defer. It runs cleanup code when leaving the current scope.

    It's nothing like go's defer: Go's defer is function-scoped and registers a callback, using is block-scoped and registers an object with a well defined protocol.

    > It differs from [...] c# “using,”

    It's pretty much a direct copy of C#'s `using` declaration (as opposed to the using statement): https://learn.microsoft.com/en-us/dotnet/csharp/language-ref....

    This can also be seen from the proposal itself (https://github.com/tc39/proposal-explicit-resource-managemen...) which cites C#'s using statement and declaration, Java's try-with-resource, and Python's context managers as prior art, but only mentions Go's defer as something you can emulate via DisposableStack and AsyncDisposableStack (types which are specifically inspired by Python's ExitStack),

  4. typescript-eslint

    :sparkles: Monorepo for all the tooling which enables ESLint to support TypeScript

    Here’s some relevant discussion about some of the footguns:

    https://github.com/typescript-eslint/typescript-eslint/issue...

    https://github.com/tc39/proposal-explicit-resource-managemen...

    I imagine there will eventually be lint rules for this somewhere and many of those using such a modern feature are likely to be using static analysis via eslint to help mitigate the risks here, but until it’s more established and understood and lint rules are fleshed out and widely adopted, there is risk here for sure.

    Seems a bit like popular lint library maintainers are overly wary to add rules before it’s better understood through wider adoption and potential adopters are wary of using it until footguns are mitigated — not quite a standstill but maybe not great either

  5. bun

    Incredibly fast JavaScript runtime, bundler, test runner, and package manager – all in one

    If you want to play with this, Bun 1.0.23+ seems to already have support: https://github.com/oven-sh/bun/discussions/4325

  6. quickjs-emscripten

    Safely execute untrusted Javascript in your Javascript, and execute synchronous code that uses async functions

    Yeah, great for that use-case - memory management; it's great to get the DisposeStack that allows "moving" out of the current scope too, that's handy.

    I adopted it for quickjs-emscripten (my quickjs in wasm thingy for untrusted code in the browser) but found that differing implementations between the TypeScript compiler and Babel lead to it not being reliably usable for my consumers. I ended up writing this code to try to work around the polyfill issues; my compiler will use Symbol.for('Symbol.dispose'), but other compilers may choose a different symbol...

    https://github.com/justjake/quickjs-emscripten/blob/aa48b619...

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts

  • Deno 2.4

    2 projects | news.ycombinator.com | 7 Jul 2025
  • efri, the_framework

    4 projects | dev.to | 13 Feb 2025
  • Bun Has Been Converted to Rust. Now What?

    5 projects | news.ycombinator.com | 3 Jun 2026
  • No SQLite driver works in both Bun and Node. Here is how I shipped one package that runs on both.

    2 projects | dev.to | 3 Jun 2026
  • Rewrite Bun in Rust has been merged

    15 projects | news.ycombinator.com | 14 May 2026

Did you know that TypeScript is
the 2nd most popular programming language
based on number of references?