Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/doug-wade/clefs
A pluggable isomorphic file system abstraction
https://github.com/doug-wade/clefs
filesystem isomorphic plugin
Last synced: about 2 months ago
JSON representation
A pluggable isomorphic file system abstraction
- Host: GitHub
- URL: https://github.com/doug-wade/clefs
- Owner: doug-wade
- Created: 2016-06-07T09:29:09.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2024-10-14T08:52:36.000Z (3 months ago)
- Last Synced: 2024-10-30T14:06:35.236Z (2 months ago)
- Topics: filesystem, isomorphic, plugin
- Language: JavaScript
- Homepage:
- Size: 1.91 MB
- Stars: 2
- Watchers: 3
- Forks: 1
- Open Issues: 13
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
Awesome Lists containing this project
README
# clefs
![Clefs logo](http://doug-wade.github.io/clefs/img/logo.svg)
A pluggable isomorphic file system abstraction
## Getting started
### Installing
Install the pluggable file system manager
```shell
npm i -S clefs
```Then install as many layers as you'll need
```shell
npm i -S clefs-localstorage clefs-fs clefs-simpleobject
```## Usage
### Node.js
Use clefs on the server!
```javascript
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!
```javascript
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](https://www.npmjs.com/package/dropbox)
1. [clefs-drive](https://www.npmjs.com/package/google-drive)
1. [clefs-box](https://www.npmjs.com/package/nodejs-box)
1. Browser tests
1. Support the full fs api## Why clefs?
[Clefs](https://en.wikipedia.org/wiki/Clef) 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](https://openclipart.org/detail/36835/bass-clef-01)
for the creative commons licensed clef image.