frontpage.
newsnewestaskshowjobs

Open Source @Github

fp.

Open in hackernews

Show HN: Ampulla: Modern TypeScript DI with NestJS Ergonomics

https://github.com/ukstv/ampulla
1•murmansk•1h ago
Yes, yet another DI library for TypeScript.

A few things kept bothering me about the existing ones, in order of how much they hurt.

- *Type safety requires a special dance.* InversifyJS has ServiceIdentifier<T>, but it is really easy to break the typing. TypeDI tokens are untyped strings. NestJS suffers mostly same, unless you use full classes as dependency tokens. TSyringe infers from constructor metadata, but all of it relies on legacy "reflect-metadata" and decorators mechanism that (a) is soon to be gone, (b) requires additional wiring.

- *Async leaks into callers.* InversifyJS has container.getAsync() for providers that might have been initialized asynchronously. That means every call site needs to know whether what it's asking for was async. The complexity never stays contained. NestJS gets this right: await everything at bootstrap, then get() is always synchronous. Initialized means ready.

- *Wiring is imperative.* InversifyJS has you call manually .bind(Token).to(Implementation) for every provider. It works, but it's ugly. NestJS figured out the right answer: declare what a module owns, what it needs, what it exposes, and let the container figure the rest out. That declarative model is the thing I wanted most, but it comes with an entire framework. NestJS gets hairy when your single app starts accepting just Nats JetStream in addition to HTTP.

- *reflect-metadata.* Every major TS DI library runs on TS "experimentalDecorators" plus a global runtime polyfill for TypeScript metadata. TC39 Stage 3 decorators shipped in TypeScript 5.0, and are soon to be natively supported in JS engines. No flags, no polyfills.

Ampulla is my attempt at fixing all four: injection<T>() tokens that carry their type intrinsically, a declarative @Module/@Injectable model lifted straight from NestJS, async-safe bootstrapping where container.get() is always synchronous, and TC39 decorators throughout.

It's intentionally just a DI container, not a framework. There is no HTTP server, no router, no CLI included. Optional adapters for Hono and H3 are included but tree-shakeable. The whole npm package has zero runtime dependencies.

Very early, 1.0.0 published just today. DI is not the most popular topic on HN, but existing DI in TypeScript is annoying enough that I had to publish something new.

GitHub: https://github.com/ukstv/ampulla | npm: npm install ampulla

NestJS and Angular SaaS Starter Kit (MIT)

https://github.com/sayahweb2-png/saas-starter-lite
1•firas_sayah•2m ago•0 comments

The abundant but expensive energy source that's under your feet

https://www.bbc.com/news/articles/cj3gj1n8yz8o
1•ksec•2m ago•0 comments

Department of Machine Verification

https://departmentofmachineverification.com/
1•nembal•4m ago•0 comments

Heat Wave in Europe Shatters Records in Denmark, Switzerland and Czech Republic

https://www.cbc.ca/news/world/europe-heatwave-2026-temperature-records-broken-9.7251458
1•runeks•5m ago•0 comments

Chinese Hedge Funds Warn the AI 'Super Bubble' Is Ready to Burst

https://www.bloomberg.com/news/articles/2026-06-26/chinese-hedge-funds-warn-the-ai-super-bubble-i...
1•aggrrrh•9m ago•2 comments

Resilient Minds

https://unesdoc.unesco.org/ark:/48223/pf0000394849
2•jruohonen•12m ago•0 comments

How we made parallel pytest safe for multi-tenant agent swarms

https://equatorops.com/resources/blog/parallel-pytest-agent-swarms
1•bobjordan•12m ago•0 comments

How Europe Became the World Champion of Heat Deaths

https://maartenboudry.substack.com/p/how-europe-became-the-world-champion
2•paulpauper•13m ago•0 comments

Ancient Tablets Show Markets Worked 4k Years Before Economists Explained Them

https://thedailyeconomy.org/article/ancient-clay-tablets-show-markets-worked-4000-years-before-ec...
1•paulpauper•13m ago•0 comments

Do Not Rule Out What Scares You [video]

https://andreagibson.substack.com/p/commencement
1•mooreds•23m ago•0 comments

CarvePHP – Find service boundaries in Laravel monoliths

https://packagist.org/packages/carvephp/carve
1•mwaleedkhalil•24m ago•0 comments

Social Structure and Anomie [pdf]

https://selfteachingresources.pbworks.com/f/Social+Structure+and+Anomie+-+Merton.pdf
1•jruohonen•27m ago•0 comments

Judgment Cannot Be Prompted

https://www.tsoon.com/posts/judgment-cannot-be-prompted/
1•mooreds•28m ago•0 comments

Traditions of Islantilla

https://www.islantilla.es/en/tradiciones/
1•mooreds•29m ago•0 comments

Gavin Newsom opposes a California wealth tax. He's proposing a national tax

https://www.cnn.com/2026/06/26/politics/gavin-newsom-billionaire-tax-california
2•Bender•34m ago•2 comments

Napster is now "AI agents you can see, talk to, and create with."

https://www.napster.com
2•romanhn•34m ago•1 comments

The Defender's Dilemma

https://markferraz.com/perspective
1•markferraz•36m ago•0 comments

How to find an investor and do it right?

https://www.goglobal.world/
1•MaxPopovggw•37m ago•0 comments

Linux MD RAID5 Seeing Scalability Improvements Up to 17%

https://www.phoronix.com/news/Linux-MD-RAID5-Scalability-Work
1•Bender•39m ago•0 comments

rdmatop: Cross-Provider Htop for RDMA Traffic

https://uccl-project.github.io/posts/rdma-monitoring/
1•tanelpoder•39m ago•0 comments

Small plane crashes into tallest building in Beijing

https://www.nytimes.com/2026/06/26/world/asia/china-plane-crash-beijing.html
2•SpyCoder77•40m ago•0 comments

Mercor's Brendan Foody calls out Sequoia over 'dual-pricing' valuation tricks

https://techcrunch.com/2026/06/08/mercors-brendan-foody-calls-out-sequoia-over-dual-pricing-valua...
2•departed•43m ago•0 comments

"No, I swear I wrote this."

https://revise.io/blog/06-27-2026/no-i-swear-i-wrote-this
4•artursapek•43m ago•0 comments

Social media bans go global: big tech faces a reckoning

https://www.theguardian.com/news/ng-interactive/2026/jun/27/social-media-bans-go-global-big-tech-...
4•dredmorbius•43m ago•0 comments

Show HN: Humans Constructively Roasting AI Coded B2B SaaS

https://www.hyoomn.com/?0
1•krm01•44m ago•1 comments

The Engineering Book Club Podcast

https://www.engineeringbookclub.com/podcast
1•eustoria•48m ago•0 comments

Turn your site into a place people can bump into each other

https://cauenapier.com/blog/townsquare_release/
2•eustoria•49m ago•0 comments

Fable 5 to return soon according to this "scoop" from axios

https://www.axios.com/2026/06/27/anthropic-fable-5-return-soon
1•jahala•49m ago•1 comments

How Boris Cherny Uses Claude Code

https://howborisusesclaudecode.com
1•eustoria•50m ago•0 comments

ARIA, Anti-Patterns, and You

https://dbushell.com/2026/06/26/aria-anti-patterns-and-you/
1•birdculture•50m ago•0 comments