gentle-fs
![Coverage Status](https://camo.githubusercontent.com/4dd0515b088ad7a5b4a63f779f7840fa24a297ce58aab189eee7ea6c7cdc19e0/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f6e706d2f67656e746c652d66732f62616467652e7376673f6272616e63683d6c6174657374)
gentle-fs
is a standalone library for "gently" remove or link directories.
Install
$ npm install gentle-fs
Table of Contents
Example
// todo
Features
- Performs filesystem operations "gently". Please see details in the API specs below for a more precise definition of "gently".
API
> rm(target, opts, cb)
Will delete all directories between target
and opts.base
, as long as they are empty. That is, if target
is /a/b/c/d/e
and base
is /a/b
, but /a/b/c
has other files besides the d
directory inside of it, /a/b/c
will remain.
Example
rm(target, opts, cb)
> link(from, to, opts, cb)
If from
is a real directory, and from
is not the same directory as to
, will symlink from
to to
, while also gently rm
ing the to
directory, and then call the callback. Otherwise, will call callback with an Error
.
Example
link(from, to, opts, cb)
> linkIfExists(from, to, opts, cb)
Performs the same operation as link
, except does nothing when from
is the same as to
, and calls the callback.
Example
linkIfExists(from, to, opts, cb)