frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Why Node.js needs a virtual file system

https://blog.platformatic.dev/why-nodejs-needs-a-virtual-file-system
63•voctor•2h ago

Comments

petcat•1h ago
Are people still building new projects on Node.js? I would have thought the ecosystem was moving to deno or bun now
rrr_oh_man•1h ago
Why?
kitsune1•1h ago
The delusion in this comment is insane.
jitl•1h ago
loud people on twitter are always switching to the new hotness. i personally can't see myself using bun until its reputation for segfaults goes away after a few more years of stabilizing. deno seems neat and has been around for longer, but its node compatibility story is still evolving; i'm also giving it another year before i try it.
_flux•50m ago
Wow, I thought you were exaggerating, but no: https://github.com/oven-sh/bun/issues?q=is%3Aissue%20state%3...

Open 80, closed 492.

dzogchen•1h ago
I don't really understand what the value proposition of Bun and Deno is. And I see huge problems with their governance and long-term sustainability.

Node.js on the other hand is not owned or controlled by one entity. It is not beholden to the whims of investors or a large corporation. I have contributed to Node.js in the past and I was really impressed by its rock-solid governance model and processes. I think this an under-appreciated feature when evaluating tech options.

packetlost•1h ago
Deno has some pretty nice unique features like sandboxing that, afaik, don't exist in other runtimes (yet). It's enough of a draw that it's the recommended runtime for projects like yt-dlp: https://github.com/yt-dlp/yt-dlp/issues/14404
worksonmine•38m ago
Node has sandboxing these days: https://nodejs.org/api/permissions.html
zamadatix•34m ago
If one gets nothing from them directly, they've at least been a good kick to get several features into Node. It's almost like neovim was to vim, perhaps to a lesser extent.
pier25•7m ago
I agree about the governance and long-term sustainability points but if you don't see any value in Bun or Deno is probably because (no offense) you are not paying attention.
zadikian•3m ago
Yes people are using Node.js, most likely the majority.
PaulHoule•1h ago
Would be nice if node packages could be packed up in ZIP files so to avoid the security/metadata tax for small file access on Windows.
MarleTangible•1h ago
The number of files in the node modules folder is crazy, any amount of organization that can tame that chaos is welcomed.
koolba•45m ago
And if you thought malware hiding in a mess of files was bad, just wait till you see it in two layers of container files.
PaulHoule•17m ago
Or worse yet, the performance load of anti-malware software that has to look inside ZIP files.

Look, most of us realized around 2004 or so that if you had a choice between Norton and the virus you would pick the virus. In the Windows world we standardized around Defender because there is some bound on how much Defender degrades the performance of your machine which was not the case with competitive antivirus software.

I've done a few projects which involved getting container file formats like ZIP and PDF (e.g. you know it's a graph of resources in which some of those resources are containers that contain more resources, right?) and now that I think of it you ought to be able to virus scan ZIP files quickly and intelligently but the whole problem with the antivirus industry is that nobody ever considers the cost.

fmorel•1h ago
I remember when Firefox started putting everything into jars for similar reasons.

https://web.archive.org/web/20161003115800/https://blog.mozi...

sheept•1h ago
Would it work to run a bundler over your code, so all (static) imports are inlined and tree shaken?
Dangeranger•53m ago
There are alternative package managers like Yarn that use zip files as a way to store each Node package.[0]

[0] https://yarnpkg.com/advanced/pnp-spec#zip-access

PaulHoule•16m ago
... and of course JAR files in Java are just ZIP files with a little extra metadata and the JVM can unpack them in realtime just fine.
MBCook•43m ago
It’s insane to me that node works how it does. Zip files make so much more sense, I really liked that about Yarn.
zadikian•2m ago
Would accessing deps directly from a zip really be faster?
moralestapia•1h ago
>Let me be honest: a PR that size would normally take months of full-time work. This one happened because I built it with Claude Code.

The node.js codebase and standard library has a very high standard of quality, hope that doesn't get washed out by sloppy AI-generated code.

OTOH, Matteo is an excellent engineer and the community owes a lot to him. So I guess the code is solid :).

austin-cheney•1h ago
Most of the 4 justifications mentioned sound like mitigations of otherwise bad design decisions. JavaScript in the browser went down this path for the longest time where new standards were introduced only to solve for stupid people instead of actually introducing new capabilities that were otherwise unachievable.

I do see some original benefits to a VFS though, bad application decisions aside, but they are exceedingly minor.

As an aside I think JavaScript would benefit from an in-memory database. This would be more of language enhancement than a Node.js enhancement. Imagine the extended application capabilities of an object/array store native to the language that takes queries using JS logic to return one or more objects/records. No SQL language and no third party databases for stuff that you don't want to keep in offline storage on a disk.

wccrawford•1h ago
I'm not convinced that allowing Node to import "code generated at runtime" is actually a good thing. I think it should have to go through the hoops to get loaded, for security reasons.

I like the idea of it mocking the file system for tests, but I feel like that should probably be part of the test suite, not Node.

The example towards the end that stores data in a sqlite provider and then saves it as a JSON file is mind-boggling to me. Especially for a system that's supposed to be about not saving to the disk. Perhaps it's just a bad example, but I'm really trying to figure out how this isn't just adding complexity.

TheRealPomax•1h ago
But then you go "hang on, doesn't ESM exist?" and you realize that argument 4 isn't even true. You can literally do what this argument says you can't, by creating a blob instead of "writing a temp file" and then importing that using the same dynamic import we've had available since <checks his watch> 2020.
notnullorvoid•30m ago
There's also a module expression proposal, that would remove the need to use blob imports.

https://github.com/tc39/proposal-module-expressions

Normal_gaussian•6m ago

    node -e "new Function('console.log(\"hi\")')()"

or more to the point

    node -e "fetch('https://unpkg.com/cowsay/build/cowsay.umd.js').then((r) => r.text()).then(c => new Function(c + 'console.log(exports.say({ text: \"like this\"}))')())"
that one is particularly bad, because umd messes with the global object - so this works

    node -e "fetch('https://unpkg.com/cowsay/build/cowsay.umd.js').then((r) => r.text()).then(c => new Function(c)()).then(() => console.log(exports.say({ text: 'oh no'})))"
westurner•1h ago
Is node::vfs the new solution for JupyterLite filesystems?

From https://github.com/jupyterlite/jupyterlite/issues/949#issuec... :

> Ideally, the virtual filesystem of JupyterLite would be shared with the one from the virtual terminal.

emscripten-core/emscripten > "New File System Implementation": https://github.com/emscripten-core/emscripten/issues/15041#i... :

> [ BrowserFS, isomorphic-git/lightningfs, ]

pyodide/pyodide: "Native file system API" #738: https://github.com/pyodide/pyodide/issues/738 re: [Chrome,] Filesystem API :

> jupyterlab-git [should work with the same VFS as Jupyter kernels and Terminals]

pyodide/pyodide: "ENH Add API for mounting native file system" #2987: https://github.com/pyodide/pyodide/pull/2987

mg•48m ago

    You can’t import or require() a module
    that only exists in memory.
You can convert it into a data url and import that, can't you?
doctorpangloss•47m ago
Yeah but Claude didn't suggest that when it wrote this blog post and did all the work so...
afavour•8m ago
What happens to relative imports?
ozlikethewizard•33m ago
I'm not convinced this needs to be in core Node, but being able to have serverless functions access a file system without providing storage would definitely have some use cases. Had some fun with video processing recently that this would be perfect for.
indutny•29m ago
Taking the question of whether this would be a useful addition to Node.js core or aside, it must be noted that this 19k LoC PR was mostly generated by Claude Code and manually reviewed by the submitter which in my opinion is against the spirit of the project and directly violates the terms of Developer's Certificate of Origin set in the project's CONTRIBUTING.md
epolanski•27m ago
Do as I say, not as I do.

On a more serious note, I think that this will be thoroughly reviewed before it gets merged and Node has an entire security team that overviews these.

indutny•15m ago
As someone who was a part of the aforementioned security team I'm not sure I'd be interested in reviewing such volume of machine generated code, expecting trap at every corner. The implicit assumption that I observed at many OSS projects I've been involved with is that first time contributions are rarely accepted if they are too large in volume, and "core contributor" designation exists to signal "I put effort into this code, stand by it, and respect everyone's time in reviewing it". The PR in the post violates this social contract.
athorax•14m ago
How exactly does it violate the Developer's Certificate of Origin clause?
indutny•8m ago
The submitted code must adhere to either of (a), (b), (c), and separately a (d) clause of: https://github.com/nodejs/node/blob/main/CONTRIBUTING.md#dev...

If submitter picks (a) they assert that they wrote the code themselves and have right to submit it under project's license. If (b) the code was taken from another place with clear license terms compatible with the project's license. If (c) contribution was written by someone else who asserted (a) or (b) and is submitted without changes.

Since LLM generated output is based on public code, but lacks attribution and the license of the original it is not possible to pick (b). (a) and (c) cannot be picked based on the submitter disclaimer in the PR body.

Normal_gaussian•23m ago
yarn pnp is currently broken on Node v25.7+;

- https://github.com/yarnpkg/berry/issues/7065

- https://github.com/nodejs/node/issues/62012

This is because yarn patches fs in order to introduce virtual file path resolution of modules in the yarn cache (which are zips), which is quite brittle and was broken by a seemingly unrelated change in 25.7.

The discussion in issue 62012 is notable - it was suggested yarn just wait for vfs to land. This is interesting to me in two ways: firstly, the node team seems quite happy for non-trivial amounts of the ecosystem to just be broken, and suggests relying on what I'm assuming will be an experimental API when it does land; secondly, it implies a lot of confidence that this feature will land before LTS.

notnullorvoid•22m ago
I could see something like this being useful if it could be passed to workers to replace any fs access inside the worker.
mohsen1•12m ago
Yarn, pnpm, webpack all have solutions for this. Great to see this becoming a standard. I have a project that is severely handicapped due to FS. Running 13k tests takes 40 minutes where a virtual file system that Node would just work with it would cut the run time to 3 minutes. I experimented with some hacks and decided to stay with slow but native FS solution.

What I really want is a way of swapping FS with VFS in a Node.js program harness. Something like

     node --use-vfs --vfs-cache=BIG_JSON_FILE 
So basically Node never touches the disk and load everything from the memory
pier25•12m ago
The Node team has lost the plot IMO.

By far the most critical issue is the over reliance on third party NPM packages for even fundamental needs like connecting to a database.

afavour•10m ago
What would a Node-native database connection layer look like? What other platforms have that?

Databases are third party tech, I don’t think it’s unreasonable to use a third party NPM module to connect to them.

ksherlock•2m ago
Perl has DBI. PHP has PDO.
beart•4m ago
Outside of sqlite, what runtimes natively include database drivers?

Give Django your time and money, not your tokens

https://www.better-simple.com/django/2026/03/16/give-django-your-time-and-money/
163•dcreager•1d ago•49 comments

Kagi Small Web

https://kagi.com/smallweb/
501•trueduke•6h ago•138 comments

OpenSUSE Kalpa

https://kalpadesktop.org/
57•ogogmad•2h ago•26 comments

FFmpeg 8.1

https://ffmpeg.org/index.html#pr8.1
121•gyan•1h ago•15 comments

Finding a CPU Design Bug in the Xbox 360

https://randomascii.wordpress.com/2018/01/07/finding-a-cpu-design-bug-in-the-xbox-360/
82•mariuz•4d ago•15 comments

Why Node.js needs a virtual file system

https://blog.platformatic.dev/why-nodejs-needs-a-virtual-file-system
65•voctor•2h ago•44 comments

Microsoft's 'unhackable' Xbox One has been hacked by 'Bliss'

https://www.tomshardware.com/video-games/console-gaming/microsofts-unhackable-xbox-one-has-been-h...
64•crtasm•1h ago•24 comments

Enabling Efficient Sparse Computations Using Linear Algebra Aware Compilers

https://www.osti.gov/biblio/3013883
38•matt_d•4d ago•5 comments

Building a Shell

https://healeycodes.com/building-a-shell
113•ingve•6h ago•23 comments

Perlsky Is a Perl 5 Implementation of an at Protocol Personal Data Server

https://tangled.org/alice.mosphere.at/perlsky
35•mooreds•4d ago•5 comments

Font Smuggler – copy hidden brand fonts into Google Docs

https://brianmoore.com/fontsmuggler/
95•lanewinfield•3d ago•52 comments

Show HN: March Madness Bracket Challenge for AI Agents Only

https://www.Bracketmadness.ai
6•bwade818•3h ago•0 comments

Leanstral: Open-source agent for trustworthy coding and formal proof engineering

https://mistral.ai/news/leanstral
673•Poudlardo•19h ago•160 comments

Show HN: Antfly: Distributed, Multimodal Search and Memory and Graphs in Go

https://github.com/antflydb/antfly
14•kingcauchy•46m ago•2 comments

The unlikely story of Teardown Multiplayer

https://blog.voxagon.se/2026/03/13/teardown-multiplayer.html
182•lairv•4d ago•43 comments

Reverse-engineering Viktor and making it Open Source

https://matijacniacki.com/blog/openviktor
99•zggf•8h ago•39 comments

Diels-grabsch2: Self Hashing C Program (2019)

https://www.ioccc.org/2019/diels-grabsch2/
9•icwtyjj•4d ago•2 comments

The Official GBBS Pro Repository

https://gbbs.applearchives.com/
4•js2•4d ago•0 comments

Kagi Translate now supports LinkedIn Speak as an output language

https://translate.kagi.com/?from=en&to=LinkedIn+speak
1140•smitec•11h ago•267 comments

Sci-Fi Short Film “There Is No Antimemetics Division” [video]

https://www.youtube.com/watch?v=3v8AsTHfAG0
223•Anon84•4d ago•60 comments

The American Healthcare Conundrum

https://github.com/rexrodeo/american-healthcare-conundrum
452•rexroad•23h ago•483 comments

Meta’s renewed commitment to jemalloc

https://engineering.fb.com/2026/03/02/data-infrastructure/investing-in-infrastructure-metas-renew...
478•hahahacorn•22h ago•220 comments

Gummy Geometry

https://newkrok.github.io/nape-js/examples.html?open=soft-body&mode=3d&outline=0
49•memalign•3d ago•7 comments

The “small web” is bigger than you might think

https://kevinboone.me/small_web_is_big.html
498•speckx•23h ago•205 comments

How long does it take to get last liquid drops from kitchen containers?

https://www.brown.edu/news/2026-03-04/kitchen-fluid-dynamics
33•hhs•4d ago•19 comments

Ryugu asteroid samples contain all DNA and RNA building blocks

https://phys.org/news/2026-03-ryugu-asteroid-samples-dna-rna.html
82•bookofjoe•4h ago•56 comments

A proposal to classify happiness as a psychiatric disorder

https://pmc.ncbi.nlm.nih.gov/articles/PMC1376114/
104•wjSgoWPm5bWAhXB•3h ago•60 comments

Every layer of review makes you 10x slower

https://apenwarr.ca/log/20260316
420•greyface-•13h ago•254 comments

Beyond has dropped “meat” from its name and expanded its high-protein drink line

https://plantbasednews.org/news/alternative-protein/beyond-meat-not-the-moment-rebrand/
186•rmason•19h ago•450 comments

Pyodide: a Python distribution based on WebAssembly

https://github.com/pyodide/pyodide
150•tosh•3d ago•39 comments