montana
v0.1.1
Published
Cache a directory and instantly swap versions using mounts
Maintainers
Readme
Montana
Montana is a utility that caches multiple versions of a directory. It allows for easy swapping of different versions and supports creating new versions.
Installing
Simply run
npm install montanato install.
Usage
The module exports the Montana class, available using var Montana = require('montana').
The class has the following API:
constructor(directory, cacheLocation): creates a new Montana instance that will manage the givendirectory. ThecacheLocationis used to store versions in.hasVersion(version): checks whether the given version existsisActive(): checks whether thedirectoryis currently mountedmount(version): mounts the givenversionondirectoryread-only, unmounting any previously mounted versionsumount()/unmount(): unmounts thedirectoryif it is currently mountedcreate(version): creates the givenversioncache of thedirectoryincacheLocation
All API functions (apart from the constructor) return a promise.
OS support
- Windows
- Not supported.
- OS X
- Supported using
hdiutil, root access not required. I've only tested on OS X 10.11 El Capitan.
- Supported using
- GNU/Linux
- If the
bindfsexecutable is available, Montana will use that instead. Root access is not required withbindfs. Note that on Debian/Ubuntu and derivatives you need to add your user to thefusegroup and make sure you have access to/dev/fuse. - If
bindfsis not available, Montana will attempt to usemountas fallback. This requires running Montana asroot.
- If the
License
See LICENSE.md
