Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

clone-packages

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

clone-packages - npm Package Compare versions

Comparing version 0.0.2 to 0.0.3

lib/fix-dependencies.js

2

lib/build-headers.js

@@ -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": {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc