npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@wtf/platform-fs-node

v1.1.0

Published

Folder handles of the WHATWG File System Standard, the browser's file system API, on the disk in Node: nodeDirectory(path) gives a folder's handle, and nodeStorage() a navigator.storage whose root is the disk's, to pass to nodePlatform({ fetch, storage })

Readme

@wtf/platform-fs-node

Get a folder handle of the WHATWG File System Standard on the disk in Node, and a navigator.storage to pass to Node's platform. It passes Node's own file system to @wtf/platform-fs-adapter, which works with any file system shaped like Node's.

| Subpath | What you get | | ----------- | ----------------------------------------------------------------------------------------------------------------------------------------- | | ./handles | nodeDirectory(path, { create }): the handle of a folder on disk; nodeFileSystem, Node's file system as the adapter takes it | | ./storage | nodeStorage(): a navigator.storage whose root is the disk's root, /, for nodePlatform({ fetch, storage }) of @wtf/platform-node |

import { nodeDirectory } from '@wtf/platform-fs-node/handles'

const root = await nodeDirectory('out', { create: true })
const file = await root.getFileHandle('notes.md', { create: true })
await new Blob(['# Notes\n']).stream().pipeTo(await file.createWritable())

A path is relative to the process's working folder. The handles are the adapter's, over Node's fs/promises, openAsBlob and the synchronous calls of node:fs, so you get:

  • snapshots that are Files on disk, read as they stream;
  • writables that write next to the file and replace it when they close, keeping its mode;
  • mode: 'exclusive', held across every process;
  • sync access to a file by createSyncAccessHandle(), through the synchronous calls of node:fs.

Whatever Node throws becomes the standard's DOMException.

Node's platform

nodeStorage() gives the root of the disk as navigator.storage.getDirectory(), so a program reaches every file by its path, resolved against dirs.cwd:

import { runMain } from '@wtf/platform-node/runtime'
import { readText } from '@wtf/platform-fs/files'
import { nodeStorage } from '@wtf/platform-fs-node/storage'

await runMain(
  async ({ platform }) => {
    platform.console.log(await readText(platform, 'package.json'))
  },
  { fetch, storage: nodeStorage() }
)

To extend the handles with calls of your own, as the adapter's README shows, make the root of your class over nodeFileSystem: MyDirectoryHandle.root(nodeFileSystem, resolve(path)).

The package depends on @wtf/platform-fs-adapter, and is the one package of the file systems that imports Node's modules. Its tests run the file system suite on a folder on disk, hold glob to Node's own, and run the Web Platform Tests of fs/, with their known failures in test/wpt/fs.json.