https://github.com/alexeveritt/modsyncr
Update locally referenced node modules whilst developing without bumping version numbers
https://github.com/alexeveritt/modsyncr
Last synced: 3 months ago
JSON representation
Update locally referenced node modules whilst developing without bumping version numbers
- Host: GitHub
- URL: https://github.com/alexeveritt/modsyncr
- Owner: alexeveritt
- License: mit
- Created: 2015-11-23T00:11:04.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2016-01-05T22:44:32.000Z (over 9 years ago)
- Last Synced: 2025-02-02T23:04:33.556Z (4 months ago)
- Language: JavaScript
- Homepage:
- Size: 355 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# modsyncr
npm install modsyncr
modsyncr makes it easy to keep locally referenced node modules in sync without requiring a package version update.
It is intended to help when working on large projects that need to be broken into seperate packages.
With modsyncr you can locally reference packages e.g. require('mysharedpackage') without having to worry about managing paths or symbolic links.Example app structure
```
mainApp // any file in mainApp can access utilApp by using require(utilApp)
|--node_modules
|--utilApp // file:../utilApp
|--dataApp // file:../dataApp
libs
|--utilApp // shared app referenced by mainApp
|--dataApp // shared app referenced by mainApp
```mainApp uses the modules utilApp and dataApp and all 3 apps are being developed at the same time. When the mainApp is run, any changes to the utilApp and dataApp will not appear in the node_modules folder of the mainApp
To force utilApp / dataApp to refresh you would either need to delete them from the mainApp node_modules folder and run npm install or bump up the version number of the utilApp/dataApp and run npm update on the mainApp
This is especially slow if there are other modules that require complication.
Modsyncr will analyse all the packages and find any locally referenced packages. It will then compare the packages and if the dependencies have changed then it will force a full update using npm update. If only files that make up the actual referenced package have changed then modsyncr will just copy the changed files over. This is extremely fast.
Modsyncr can be run as part of a grunt/gulp build routine or run from the command line
Code usage
var modsyncr = require(‘modsyncr’);
modsyncr.sync(function done(){
console.log(‘sync done!’);
});command line
node modsyncrglobal install
npm install –g modsyncrTODO
Create Gulp Task to run as part of build steps
Add watcher to keep files in sync as they change
Handle error when a module is renamed