@criteria/file-system-react
TypeScript icon, indicating that this package has built-in type declarations

0.2.5 • Public • Published

@criteria/file-system-react

React hooks for working with the File System API.

Getting Started

Get all file handles within the origin private file system (OPFS), including the root directory handle:

import { useFileSystem } from "@criteria/file-system-react";

function Component() {
  const handlesByPath = useFileSystem();

  return (
    <ul>
      {Object.entries(handlesByPath).map(([path, handle]) => (
        <li key={path}>{path}</li>
      ))}
    <ul>
  );
}

/@criteria/file-system-react/

    Package Sidebar

    Install

    npm i @criteria/file-system-react

    Weekly Downloads

    27

    Version

    0.2.5

    License

    MIT

    Unpacked Size

    34.8 kB

    Total Files

    14

    Last publish

    Collaborators

    • jamesmoschou-criteria