Lets assume I have a mainFolder and 3 subfolders (subFolderA, subfolderB, subfolderC).
And these subfolders all contain a package.json with dependencies and devDependencies. (mainFolder/subFolderA/package.json)
I want to combine them into a single package.json in mainFolder (mainFolder/package.json)
Is there an existing gulp package (or any other solution outside Gulp) to combine and merge package.json dependencies and devDependencies?
(Let's assume there will be no version conflict. If there is a solution also covers that case, thats great!)
Can you post an example gulpfile.js or explain other ways/tools.
Thank you
You can try package-json-merge
npm module. To install it, use this command -
npm install -g package-json-merge
Then simply use below command to combine multiple package.json into a single one -
package-json-merge package1.json package2.json .... packageN.json > package.json
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With