Rename/Move CJS module(s) and update all affected requires
- Package root is intelligently detected
- Content of eventual node_modules (external dependencies) folder is not affected
- All files as ignored by .gitignore rules are not touched (it is assumed they're most likely generated files, which will automatically be fixed by regeneration).
- Moved module must reside in some package
otherwise root of a system is perceived as a root of a package, and operation is aborted (to not proceed with whole system files search for affected modules)
- Modules can be moved only within a scope of same package. For obvious reasons move across different packages will fail
$ npm install -g movejs
$ movejs sourcePath destPath
sourcePath can be either module file path or directory path.
destPath must not be taken.
Verbose logging of underlying operations is possible with additional setting of
$ DEBUG=movejs movejs sourcePath destPath
Move/rename single module file or directory of modules
var mv = ;;
Move/rename single module file
var mvModule = ;;
Move/rename directory of modules
var mvDir = ;;
$ npm test