JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 4482482
  • Score
    100M100P100Q239955F
  • License Apache-2.0

File System Access API implementation backed by core filesystem primitives

Package Exports

  • @jsonjoy.com/fs-fsa
  • @jsonjoy.com/fs-fsa/lib/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@jsonjoy.com/fs-fsa) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

@jsonjoy.com/fs-fsa

File System Access API implementation backed by @jsonjoy.com/fs-core primitives.

Provides a File System Access API implementation that works with the Superblock filesystem abstraction.

Installation

npm install @jsonjoy.com/fs-fsa

Usage

import { fsa } from '@jsonjoy.com/fs-fsa';

const { dir, core, FileSystemObserver } = fsa({ mode: 'readwrite' });

// Create a file
const fileHandle = await dir.getFileHandle('hello.txt', { create: true });
const writable = await fileHandle.createWritable();
await writable.write('Hello, World!');
await writable.close();

// Read a file
const file = await fileHandle.getFile();
const contents = await file.text();
console.log(contents); // 'Hello, World!'

License

Apache-2.0