Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hayes/relocate
https://github.com/hayes/relocate
Last synced: about 6 hours ago
JSON representation
- Host: GitHub
- URL: https://github.com/hayes/relocate
- Owner: hayes
- License: mit
- Created: 2014-09-25T23:50:46.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2014-10-06T17:40:40.000Z (about 10 years ago)
- Last Synced: 2024-10-12T13:46:08.870Z (about 1 month ago)
- Language: JavaScript
- Size: 383 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
# relocate
## Usage
`relocate test test/unit --remove`
or
`relocate test.js test/unit.js --remove`### flags
* `--remove` or `-r` remove original files after moving
* `--ignore` or `-i` ignore file/dir defaults to ignoring `.git` and `node_modules`
* `--transform` or `-t` path to transform module.
* `--force` or `-f` overwrite existing files`transform` and `ignore` can be added multiple times
`relocate foo foo/bar -i test -i .git`### transforms
transform paths should point to a module that exports a single function.
this function is called with 4 arguments.
* content: the file content
* src: the original file location
* dest: the new file location
* done: callback that must be called with 2 arguments
* error: an error object or null
* content: the transformed content## API
###`relocate(src, dest, options, done)`
* src: the original file location
* dest: the new file location
* options: object
* force: boolean
* ignores: array of file or directory names
* transforms: array of functions
* remove: boolean
* done: callback