enfsmove
v1.0.0
Published
move files and directories in the file system for node
Downloads
48
Maintainers
Readme
enfsmove
Module that add move functionality to node fs module
enfs stands for [E]asy [N]ode [fs]
This module is intended to work as a sub-module of enfs
Description
This module will add a method that allows moving files and directories in the file system.
- This module will add following methods to node fs module:
- move
- moveSync
Usage
enfsmove
var enfsmove = require("enfsmove");
Errors
All the methods follows the node culture.
- Async: Every async method returns an Error in the first callback parameter
- Sync: Every sync method throws an Error.
Additional Methods
move
- move(srcPath, dstPatch, [options], callback)
Move files and directories in the file system
[options]:
- fs (Object): an alternative fs module to use (default will be enfspatch)
- mkdirp (Boolean): if true will create new directories instead of copying the old ones (default: false)
- overwrite (Boolean): if true will overwrite items at destination if they exist (Default: false)
- limit (Number): the maximum number of items being moved at a moment (Default: 512)
enfsmove.move("/home/myHome","/home/myOtherHome", function(err){
if(!err) {
console.log("Everything moved correctly");
}
});
moveSync
- moveSync(srcPath, dstPath, [options])
Move files and directories in the file system
[options]:
- fs (Object): an alternative fs module to use (default will be enfspatch)
- mkdirp (Boolean): if true will create new directories instead of copying the old ones (default: false)
- overwrite (Boolean): if true will overwrite items at destination if they exist (Default: false)
- limit (Number): the maximum number of items being moved at a moment (Default: 512)
enfsmove.moveSync("/home/myHome","/home/myOtherHome");
console.log("Everything moved correctly");
License
Creative Commons Attribution 4.0 International License
Copyright (c) 2016 Joao Parreira [email protected] GitHub
This work is licensed under the Creative Commons Attribution 4.0 International License. To view a copy of this license, visit CC-BY-4.0.