Giter Club home page Giter Club logo

distfs's Introduction

DistFS

Pull-based virtual filesystem to expose directory trees of ES6 code as Babel-compiled code.

Uses FUSE to mount a user-space filesystem that exposes the same directory structure but, when you read the actual files, gives you the compiled scripts instead of the original content. Will block accesses to the file until the compilation is done, so that you're always sure that you have the up-to-date code.

Changes to source files will automatically show up in the virtual files.

To an extent, should should be able to use fs.watch on files in the virtual file system to notice when they are updated.

Usage:

distfs src dist

Where src is your source dir and dist is a directory (may be empty, doesn't have to be) to be used as mount point. After doing this, you'll have the compiled version of src/foo/bar.js available as dist/foo/bar.js.

Caveats

Only tested on Linux. Might work on OS X, likely not on Windows.

DistFS will cache all content in entirely memory. This is usually good, since it means you can access precompiled code quickly, but it also means that if you accidentally access a giant file through this, it'll waste a lot of memory. To be safe, mount directories containing only source code.

distfs's People

Contributors

andreypopp avatar marijnh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

tjvr andreypopp

distfs's Issues

Git checkout crashes the server

When I have distfs running on ProseMirror and switch to a different branch, the process will crash, and block all further access to the dist directory. This happens even if there are no git-controlled files in dist.

One theory is that the rapid touching of a ton of files in the source directory causes our scary delete-file-to-make-inotify-work hack to somehow lock up the server process. Need to do more strace-ing to debug.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.