Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zswang/proxy-fs
A simple proxy filesystem.
https://github.com/zswang/proxy-fs
filesystem
Last synced: about 1 month ago
JSON representation
A simple proxy filesystem.
- Host: GitHub
- URL: https://github.com/zswang/proxy-fs
- Owner: zswang
- Created: 2016-06-23T14:27:23.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2016-06-28T06:24:49.000Z (over 8 years ago)
- Last Synced: 2024-08-08T23:13:16.320Z (3 months ago)
- Topics: filesystem
- Language: JavaScript
- Size: 9.77 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
proxy-fs
-----A simple proxy filesystem.
# [![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Coverage Status][coverage-image]][coverage-url]
## example
```js
var mfs = new MemoryFileSystem({});
var pfs = new ProxyFileSystem(function (path) {
if (/abc/.test(path)) {
return {
path: '/data/hello.js',
fileSystem: mfs
};
}
});mfs.mkdirpSync('/data');
mfs.writeFileSync('/data/hello.js', 'hello');
console.log(String(pfs.readFileSync('/data/abc.js')));
// > hello
```## License
MIT © [zswang](http://weibo.com/zswang)
[npm-url]: https://npmjs.org/package/proxy-fs
[npm-image]: https://badge.fury.io/js/proxy-fs.svg
[travis-url]: https://travis-ci.org/zswang/proxy-fs
[travis-image]: https://travis-ci.org/zswang/proxy-fs.svg?branch=master
[coverage-url]: https://coveralls.io/github/zswang/proxy-fs?branch=master
[coverage-image]: https://coveralls.io/repos/zswang/proxy-fs/badge.svg?branch=master&service=github