All Projects → streamich → unionfs

streamich / unionfs

Licence: Unlicense license
Use multiple fs modules at once

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to unionfs

Fast Glob
🚀 It's a very fast and efficient glob library for Node.js
Stars: ✭ 1,150 (+576.47%)
Mutual labels:  filesystem, fs
Mergerfs
a featureful union filesystem
Stars: ✭ 2,114 (+1143.53%)
Mutual labels:  filesystem, unionfs
Zbox
Zero-details, privacy-focused in-app file system.
Stars: ✭ 1,185 (+597.06%)
Mutual labels:  filesystem, fs
Fdir
⚡ The fastest directory crawler & globbing library for NodeJS. Crawls 1m files in < 1s
Stars: ✭ 777 (+357.06%)
Mutual labels:  filesystem, fs
dropbox-fs
📦 Node FS wrapper for Dropbox
Stars: ✭ 35 (-79.41%)
Mutual labels:  filesystem, fs
Node Ntfs
Windows NT File System (NTFS) file system driver
Stars: ✭ 18 (-89.41%)
Mutual labels:  filesystem, fs
Litfs
A FUSE file system in Go extended with persistent file storage
Stars: ✭ 116 (-31.76%)
Mutual labels:  filesystem, fs
Tfs
Mirror of https://gitlab.redox-os.org/redox-os/tfs
Stars: ✭ 2,890 (+1600%)
Mutual labels:  filesystem, fs
fu
Unix's Find, Unleashed.
Stars: ✭ 32 (-81.18%)
Mutual labels:  filesystem, fs
Draxt
draxt.js – NodeList/jQuery-like package for File System (node.js)
Stars: ✭ 192 (+12.94%)
Mutual labels:  filesystem, fs
Electron Filesystem
FileSystem for windows
Stars: ✭ 409 (+140.59%)
Mutual labels:  filesystem, fs
rxnode
Rxnode - a small and fast wrapper around the nodejs API using RxJS.
Stars: ✭ 24 (-85.88%)
Mutual labels:  filesystem, fs
Filer
Node-like file system for browsers
Stars: ✭ 389 (+128.82%)
Mutual labels:  filesystem, fs
Memfs
In-memory filesystem with Node's API
Stars: ✭ 854 (+402.35%)
Mutual labels:  filesystem, fs
Chonky
😸 A File Browser component for React.
Stars: ✭ 313 (+84.12%)
Mutual labels:  filesystem, fs
Flint
Fast and configurable filesystem (file and directory names) linter
Stars: ✭ 115 (-32.35%)
Mutual labels:  filesystem, fs
fs.c
File system API much like Node's fs module (synchronous)
Stars: ✭ 65 (-61.76%)
Mutual labels:  filesystem, fs
mongoose-gridfs
mongoose gridfs on top of new gridfs api
Stars: ✭ 79 (-53.53%)
Mutual labels:  filesystem, fs
Nohost
A web server in your web browser
Stars: ✭ 164 (-3.53%)
Mutual labels:  filesystem, fs
fs-fuse
Export any Node.js `fs`-like object as a FUSE filesystem
Stars: ✭ 32 (-81.18%)
Mutual labels:  filesystem, fs

unionfs

Creates a union of multiple fs file systems.

npm install --save unionfs

This module allows you to use multiple objects that have file system fs API at the same time.

import { ufs } from 'unionfs';
import { fs as fs1 } from 'memfs';
import * as fs2 from 'fs';

ufs.use(fs1).use(fs2);

ufs.readFileSync(/* ... */);

Use this module with memfs and linkfs. memfs allows you to create virtual in-memory file system. linkfs allows you to redirect fs paths.

You can also use other fs-like objects.

import * as fs from 'fs';
import { Volume } from 'memfs';
import * as MemoryFileSystem from 'memory-fs';
import { ufs } from 'unionfs';

const vol1 = Volume.fromJSON({ '/memfs-1': '1' });
const vol2 = Volume.fromJSON({ '/memfs-2': '2' });

const memoryFs = new MemoryFileSystem();
memoryFs.writeFileSync('/memory-fs', '3');

ufs.use(fs).use(vol1).use(vol2).use(memoryFs);

console.log(ufs.readFileSync('/memfs-1', 'utf8')); // 1
console.log(ufs.readFileSync('/memfs-2', 'utf8')); // 2
console.log(ufs.readFileSync('/memory-fs', 'utf8')); // 3

You can create a Union instance manually:

import { Union } from 'unionfs';

var ufs1 = new Union();
ufs1.use(fs).use(vol);

var ufs2 = new Union();
ufs2.use(fs).use(/*...*/);

License

Unlicense - public domain.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].