package-merger
Advanced tools
Comparing version 1.0.2 to 1.0.3
15
index.js
#! /usr/bin/env node | ||
var fs = require("fs"), | ||
path = require("path"), | ||
async = require('async'), | ||
objectMerge = require('object-merge'); | ||
async = require('async'); | ||
var cwd = process.cwd(); | ||
var masterPackageJson={ | ||
@@ -16,2 +16,9 @@ "name": "package-merger-dummy", | ||
function merge_options(obj1,obj2){ | ||
var obj3 = {}; | ||
for (var attrname in obj1) { obj3[attrname] = obj1[attrname]; } | ||
for (var attrname in obj2) { obj3[attrname] = obj2[attrname]; } | ||
return obj3; | ||
} | ||
fs.readdir(cwd, function (err, files) { | ||
@@ -24,3 +31,3 @@ var folders=[]; | ||
if(fs.statSync(file).isDirectory() && fs.existsSync(path.join(cwd,file,"package.json"))){ | ||
masterPackageJson.dependencies = objectMerge(objectMerge.dependencies,require(path.join(cwd,file,"package.json")).dependencies); | ||
masterPackageJson.dependencies = merge_options(masterPackageJson.dependencies,require(path.join(cwd,file,"package.json")).dependencies); | ||
cb(null); | ||
@@ -35,2 +42,2 @@ } | ||
}) | ||
}); | ||
}); |
{ | ||
"name": "package-merger", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "This modules reads all directories inside current directory for package.json files and creates a master package.json", | ||
@@ -22,5 +22,4 @@ "preferGlobal": true, | ||
"dependencies": { | ||
"async": "^0.9.0", | ||
"object-merge": "^2.5.1" | ||
"async": "^0.9.0" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
24077
1
12
35
- Removedobject-merge@^2.5.1
- Removedclone-function@1.0.6(transitive)
- Removedobject-foreach@0.1.2(transitive)
- Removedobject-merge@2.5.1(transitive)