clefs-simpleobject

An fs abstraction backed by an object


Keywords
fs, isomorphic, layers, filesystem, plugin
License
MIT
Install
npm install clefs-simpleobject@0.0.4

Documentation

clefs

Travis badge

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

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

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.