Montana is a utility that caches multiple versions of a directory. It allows for easy swapping of different versions and supports creating new versions.
Simply run
npm install montana
to install.
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
. ThecacheLocation
is used to store versions in.hasVersion(version)
: checks whether the given version existsisActive()
: checks whether thedirectory
is currently mountedmount(version)
: mounts the givenversion
ondirectory
read-only, unmounting any previously mounted versionsumount()
/unmount()
: unmounts thedirectory
if it is currently mountedcreate(version)
: creates the givenversion
cache of thedirectory
incacheLocation
All API functions (apart from the constructor) return a promise.
- 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
bindfs
executable 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 thefuse
group and make sure you have access to/dev/fuse
. - If
bindfs
is not available, Montana will attempt to usemount
as fallback. This requires running Montana asroot
.
- If the
See LICENSE.md