@jsonjoy.com/fs-node-to-fsa
Adapter to convert Node.js fs API to File System Access API
Last updated 5 months ago by GitHub Actions .
Apache-2.0 · Repository · Bugs · Original npm · Tarball · package.json
$ npm install @jsonjoy.com/fs-node-to-fsa 
SYNC missed versions from official npm registry.

@jsonjoy.com/fs-node-to-fsa

Adapter to convert Node.js fs API to File System Access API (FSA).

Installation

npm install @jsonjoy.com/fs-node-to-fsa

Usage

import { nodeToFsa } from '@jsonjoy.com/fs-node-to-fsa';
import * as fs from 'fs';

const dir = nodeToFsa(fs, '/path/to/directory', { mode: 'readwrite' });

// Now use the FSA API
for await (const [name, handle] of dir.entries()) {
  console.log(name, handle.kind);
}

FileSystemObserver

NodeFileSystemObserver implements the FileSystemObserver proposal on top of the Node.js fs.watch API. It is a best-effort implementation, per the proposal's allowance for local file systems: rename events are classified into "appeared"/"disappeared" records by stat-ing the path, and no "moved" records are ever produced.

import { nodeToFsa, NodeFileSystemObserver } from '@jsonjoy.com/fs-node-to-fsa';
import * as fs from 'fs';

const dir = nodeToFsa(fs, '/path/to/directory', { mode: 'readwrite' });
const observer = new NodeFileSystemObserver(fs, records => console.log(records));
await observer.observe(dir, { recursive: true });

Reference

Current Tags

  • 4.80.1                                ...           latest (15 days ago)

49 Versions

  • 4.80.1                                ...           15 days ago
  • 4.80.0                                ...           2 months ago
  • 4.79.0                                ...           2 months ago
  • 4.78.1                                ...           2 months ago
  • 4.78.0                                ...           2 months ago
  • 4.77.0                                ...           2 months ago
  • 4.76.0                                ...           2 months ago
  • 4.75.0                                ...           3 months ago
  • 4.74.0                                ...           3 months ago
  • 4.73.0                                ...           3 months ago
  • 4.72.2                                ...           3 months ago
  • 4.72.1                                ...           3 months ago
  • 4.72.0                                ...           3 months ago
  • 4.71.1                                ...           3 months ago
  • 4.71.0                                ...           3 months ago
  • 4.70.0                                ...           3 months ago
  • 4.69.1                                ...           3 months ago
  • 4.69.0                                ...           3 months ago
  • 4.68.2                                ...           3 months ago
  • 4.68.1                                ...           4 months ago
  • 4.68.0                                ...           4 months ago
  • 4.67.0                                ...           4 months ago
  • 4.66.1                                ...           4 months ago
  • 4.66.0                                ...           4 months ago
  • 4.65.0                                ...           4 months ago
  • 4.64.0                                ...           5 months ago
  • 4.63.0                                ...           5 months ago
  • 4.62.0                                ...           5 months ago
  • 4.61.0                                ...           5 months ago
  • 4.60.0                                ...           5 months ago
  • 4.59.0                                ...           5 months ago
  • 4.58.0                                ...           5 months ago
  • 4.57.8                                ...           5 months ago
  • 4.57.7                                ...           6 months ago
  • 4.57.6                                ...           6 months ago
  • 4.57.5                                ...           6 months ago
  • 4.57.4                                ...           6 months ago
  • 4.57.3                                ...           6 months ago
  • 4.57.2                                ...           7 months ago
  • 4.57.1                                ...           8 months ago
  • 4.57.0                                ...           8 months ago
  • 4.56.11                                ...           9 months ago
  • 4.56.10                                ...           10 months ago
  • 4.56.9                                ...           10 months ago
  • 4.56.8                                ...           10 months ago
  • 4.56.7                                ...           10 months ago
  • 4.56.4                                ...           10 months ago
  • 4.56.2                                ...           10 months ago
  • 4.56.1                                ...           10 months ago
Downloads
Total 177
Today 0
This Week 0
This Month 100
Last Day 0
Last Week 42
Last Month 48
Dev Dependencies (9)
Dependents (1)

© 2010 - cnpmjs.org x YWFE | Home | YWFE