dependent-path-update
A tool to update dependent paths when renaming a file.
This uses regexps based on the folder depth to match all possible relative require paths in to file and updates all of those paths to a new path. Ultimately allowing you to rename a file and updating all dependents (not just js files!).
Install
npm install --save dependent-path-update
CLI
Example
dependent-path-update ./from-file-name.js ./to-file-name.js # Or a shorthanddpu ./from-file-name.js ./to-file-name.js
Options
--include -i
: Pattern of files to match when updating, eg:"*.json"
for only updating json files.--exclude -e
: Pattern of files to exclude when updating, eg:"*.json"
will not update any json files.--project-dir -d
: The root directory from which all paths must be relative (default to CWD).
API
; ;