Skip to content

A pluggable isomorphic file system abstraction

Notifications You must be signed in to change notification settings

doug-wade/clefs

Repository files navigation

clefs

Clefs logo

A pluggable isomorphic file system abstraction

Getting started

Installing

Install the pluggable file system manager

npm i -S clefs

Then install as many layers as you'll need

npm i -S clefs-localstorage clefs-fs clefs-simpleobject

Usage

Node.js

Use clefs on the server!

import clefs from 'clefs';
import clefsFs from 'clefs-fs';
import clefsCache from 'clefs-simpleobject';

const fs = clefs([clefsCache, clefsFs]);
const fileContents = await fs.readFile('/path/to/file.txt');
console.log(fileContents);

Browser

Use clefs in the browser!

import clefs from 'clefs/browser';
import localstorage from 'clefs-localstorage';
import clefsCache from 'clefs-simpleobject';

const fs = clefs([clefsCache, localstorage]);
const fileContents = await fs.readFile('/path/to/file.txt');
console.log(fileContents);

Roadmap

  1. clefs-dropbox
  2. clefs-drive
  3. clefs-box
  4. Browser tests
  5. Support the full fs api

Why clefs?

Clefs have layers.

Sure, but why would I use clefs?

Write through from a cache to a local file system or browser local storage and to a cloud file storage provider with a single call. Has a pleasant promise-based interface that works nicely with async and await.

Special Thanks

Special thanks to jonadab for the creative commons licensed clef image.

About

A pluggable isomorphic file system abstraction

Topics

Resources

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published