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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@zenfs/dom

v1.1.6

Published

DOM backends for ZenFS

Downloads

1,600

Readme

ZenFS DOM Backends

ZenFS backends for DOM APIs. DOM APIs are only available natively in browsers.

Please read the ZenFS core documentation!

Backends

  • WebStorage stores files in a Storage object, like localStorage and sessionStorage.
  • IndexedDB stores files into an IndexedDB object database.
  • WebAccess uses the File System Access API.
  • XML uses an XMLDocument to store files, which can be appended to the DOM.

For more information, see the API documentation.

Usage

You can use the backends from @zenfs/dom just like the backends from @zenfs/core:

import { configure, fs } from '@zenfs/core';
import { WebStorage } from '@zenfs/dom';

await configureSingle({ backend: WebStorage, storage: localStorage });

if (!fs.existsSync('/test.txt')) {
	fs.writeFileSync('/test.txt', 'This will persist across reloads!');
}

const contents = fs.readFileSync('/test.txt', 'utf-8');
console.log(contents);

XML

The XML backend can be used to create a file system which lives in the DOM:

<!-- ... -->
<fs />
<!-- ... -->
import { configure, fs } from '@zenfs/core';
import { XML } from '@zenfs/dom';

await configureSingle({
	backend: XML,
	root: document.querySelector('fs'), // root is optional
});

fs.writeFileSync('/test.txt', 'This is in the DOM!');

If you choose to add the root element to the DOM by appending it, you will likely want to hide its contents (display:none works well).

The root option is not required. If you choose not to pass in a root, you can always append it to the DOM later:

import { configure, fs, mounts } from '@zenfs/core';
import { XML } from '@zenfs/dom';

await configureSingle({ backend: XML });

const { root } = mounts.get('/');

document.body.append(root);

This may disrupt use cases that involve saving the HTML file locally and loading it later, since a new element is created when configuring. In contrast, when using an existing element and passing in a root, the existing element's contents will be preserved.