clone-packages
Advanced tools
Comparing version 0.0.2 to 0.0.3
@@ -23,5 +23,5 @@ var Buffer = require('buffer').Buffer | ||
'Basic ' + credentials : | ||
'Basic ' + new Buffer(credentials.user + ':' + credentials.password) | ||
'Basic ' + new Buffer(credentials.username + ':' + credentials.password) | ||
.toString('base64') | ||
} | ||
@@ -5,2 +5,4 @@ var concat = require('concat-stream') | ||
, crypto = require('crypto') | ||
, zlib = require('zlib') | ||
, tar = require('tar') | ||
, url = require('url') | ||
@@ -11,2 +13,4 @@ | ||
var readme = /^([^\/]+)\/readme(\.(md|rst|mkd|markdown|txt))?$/i | ||
module.exports = clone | ||
@@ -36,5 +40,8 @@ | ||
var shasum = crypto.createHash('sha1') | ||
, parse = tar.Parse() | ||
, metadata | ||
, tarball | ||
, publish | ||
, parsed | ||
, setup | ||
, dist | ||
@@ -70,2 +77,28 @@ , sha | ||
parse.on('entry', function(data) { | ||
if(readme.test(data.path)) { | ||
data.pipe(concat(attachReadme)) | ||
.on('error', onerror) | ||
} | ||
function attachReadme(data) { | ||
metadata.readme = data.toString() | ||
parse.end() | ||
} | ||
}) | ||
parse.on('end', function() { | ||
if(setup) { | ||
return publishPackage() | ||
} | ||
parsed = true | ||
}) | ||
tarball | ||
.pipe(zlib.createGunzip()) | ||
.on('error', onerror) | ||
.pipe(parse) | ||
.on('error', onerror) | ||
tarball.pipe(shasum).on('data', function(buf) { | ||
@@ -106,2 +139,10 @@ sha = buf.toString('hex') | ||
if(parsed) { | ||
return publishPackage() | ||
} | ||
setup = true | ||
} | ||
function publishPackage() { | ||
var content = JSON.stringify(metadata) | ||
@@ -108,0 +149,0 @@ |
{ | ||
"name": "clone-packages", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"description": "clone packages from one repo to another", | ||
@@ -33,3 +33,4 @@ "main": "index.js", | ||
"minimist": "0.0.8", | ||
"ansicolors": "^0.3.2" | ||
"ansicolors": "^0.3.2", | ||
"tar": "^0.1.19" | ||
}, | ||
@@ -36,0 +37,0 @@ "devDependencies": { |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 2 instances in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
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
126897
17
3646
6
3
7
+ Addedtar@^0.1.19
+ Addedbalanced-match@1.0.2(transitive)
+ Addedblock-stream@0.0.9(transitive)
+ Addedbrace-expansion@1.1.11(transitive)
+ Addedconcat-map@0.0.1(transitive)
+ Addedfs.realpath@1.0.0(transitive)
+ Addedfstream@0.1.31(transitive)
+ Addedglob@7.2.3(transitive)
+ Addedgraceful-fs@3.0.12(transitive)
+ Addedinflight@1.0.6(transitive)
+ Addedminimatch@3.1.2(transitive)
+ Addedminimist@1.2.8(transitive)
+ Addedmkdirp@0.5.6(transitive)
+ Addednatives@1.1.6(transitive)
+ Addedonce@1.4.0(transitive)
+ Addedpath-is-absolute@1.0.1(transitive)
+ Addedrimraf@2.7.1(transitive)
+ Addedtar@0.1.20(transitive)
+ Addedwrappy@1.0.2(transitive)