asic-verify
Advanced tools
Comparing version 0.0.0 to 0.1.0
17
cli.js
@@ -1,1 +0,16 @@ | ||
throw new Error("Not implemented"); | ||
"use strict"; | ||
var fn = process.argv[2]; | ||
if (!fn) { | ||
throw new Error("File name not provided"); | ||
} | ||
process.on("unhandledRejection", function (err) { | ||
console.warn("Unhandled rejection:", err, "\n", err.stack); | ||
}); | ||
require("./index.js")(fn, function (err) { | ||
if (err) throw err; | ||
console.log("OK"); | ||
}); |
39
index.js
@@ -1,3 +0,36 @@ | ||
module.exports = function verifyAsic() { | ||
throw new Error("Not implemented"); | ||
}; | ||
"use strict"; | ||
var yauzl = require("yauzl"); | ||
var getZipEntries = require("./lib/getZipEntries"), | ||
verifyMimetype = require("./lib/verifyMimetype"), | ||
verifyManifest = require("./lib/verifyManifest"), | ||
verifySignatures = require("./lib/verifySignatures"); | ||
function verifyAsic(fn, cb) { | ||
yauzl.open(fn, {autoClose: false}, function (err, zipfile) { | ||
if (err) { | ||
return cb(err); | ||
} | ||
getZipEntries(zipfile) | ||
.then(function (entries) { | ||
return Promise.all([ | ||
verifyMimetype(zipfile, entries), | ||
verifyManifest(zipfile, entries), | ||
verifySignatures(zipfile, entries) | ||
]); | ||
}) | ||
.then(function () { | ||
cb(null); | ||
}) | ||
.catch(function (err) { | ||
cb(err); | ||
}) | ||
.then(function () { | ||
zipfile.close(); | ||
}); | ||
}); | ||
} | ||
module.exports = verifyAsic; |
{ | ||
"name": "asic-verify", | ||
"version": "0.0.0", | ||
"version": "0.1.0", | ||
"description": "Verify ASiC (Associated Signature Container)", | ||
"main": "index.js", | ||
"files": [ | ||
"cli.js", | ||
"index.js", | ||
"lib/" | ||
], | ||
"bin": { | ||
@@ -21,3 +26,3 @@ "asic-verify": "./cli.js" | ||
], | ||
"author": "MB H6.LT", | ||
"author": "MB H6.LT <info@lexplano.com>", | ||
"license": "MIT", | ||
@@ -27,3 +32,14 @@ "bugs": { | ||
}, | ||
"homepage": "https://github.com/lexplano/asic-verify#readme" | ||
"homepage": "https://github.com/lexplano/asic-verify#readme", | ||
"engines": { | ||
"node": ">=1" | ||
}, | ||
"dependencies": { | ||
"concat-stream": "1.x", | ||
"denodeify": "1.x", | ||
"lodash": "3.x", | ||
"q": "1.x", | ||
"xml2js": "0.4.x", | ||
"yauzl": "2.x" | ||
} | ||
} |
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
Trivial Package
Supply chain riskPackages less than 10 lines of code are easily copied into your own project and may not warrant the additional supply chain risk of an external dependency.
Found 1 instance in 1 package
268
11213
6
12
+ Addedconcat-stream@1.x
+ Addeddenodeify@1.x
+ Addedlodash@3.x
+ Addedq@1.x
+ Addedxml2js@0.4.x
+ Addedyauzl@2.x
+ Addedbuffer-crc32@0.2.13(transitive)
+ Addedbuffer-from@1.1.2(transitive)
+ Addedconcat-stream@1.6.2(transitive)
+ Addedcore-util-is@1.0.3(transitive)
+ Addeddenodeify@1.2.1(transitive)
+ Addedfd-slicer@1.1.0(transitive)
+ Addedinherits@2.0.4(transitive)
+ Addedisarray@1.0.0(transitive)
+ Addedlodash@3.10.1(transitive)
+ Addedpend@1.2.0(transitive)
+ Addedprocess-nextick-args@2.0.1(transitive)
+ Addedq@1.5.1(transitive)
+ Addedreadable-stream@2.3.8(transitive)
+ Addedsafe-buffer@5.1.2(transitive)
+ Addedsax@1.4.1(transitive)
+ Addedstring_decoder@1.1.1(transitive)
+ Addedtypedarray@0.0.6(transitive)
+ Addedutil-deprecate@1.0.2(transitive)
+ Addedxml2js@0.4.23(transitive)
+ Addedxmlbuilder@11.0.1(transitive)
+ Addedyauzl@2.10.0(transitive)