s3-npm-cache
Advanced tools
Comparing version 0.0.11 to 0.0.12
@@ -1,15 +0,26 @@ | ||
var s3 = require('aws2js') | ||
.load('s3', process.env.AWS_ACCESS_KEY_ID, process.env.AWS_SECRET_ACCESS_KEY); | ||
var AWS = require('aws-sdk'); | ||
AWS.config.update({ | ||
region: 'ap-southeast-2' | ||
}); | ||
var s3 = new AWS.S3(), | ||
s3BucketName; | ||
var shell = require('shelljs'), | ||
AdmZip = require('adm-zip'), | ||
q = require('q'), | ||
fs = require('fs'); | ||
q = require('q'); | ||
var setS3BucketName = function (name) { | ||
s3.setBucket(name); | ||
s3BucketName = name; | ||
}; | ||
var uploadFileToS3 = function (fileName, zipBuffer) { | ||
s3.putBuffer('/' + fileName, zipBuffer, 'bucket-owner-full-control', { 'Content-Type': 'application/zip' }, function (err) { | ||
s3.putObject({ | ||
Bucket: s3BucketName, | ||
Key: fileName, | ||
ACL: 'bucket-owner-full-control', | ||
ContentType: 'application/zip', | ||
Body: zipBuffer | ||
}, function (err) { | ||
if (err) { | ||
@@ -26,7 +37,10 @@ console.error('Failed to upload file', err); | ||
s3.get(fileName, {}, 'buffer', function (err, res) { | ||
s3.getObject({ | ||
Bucket: s3BucketName, | ||
Key: fileName | ||
}, function (err, data) { | ||
if (err) { | ||
defer.reject(err); | ||
} else if (res && res.buffer) { | ||
defer.resolve(res.buffer); | ||
} else if (data && data.Body) { | ||
defer.resolve(data.Body); | ||
} else { | ||
@@ -33,0 +47,0 @@ defer.reject('No errors downloading the file but no buffer. Please try again.'); |
{ | ||
"name": "s3-npm-cache", | ||
"version": "0.0.11", | ||
"version": "0.0.12", | ||
"description": "Forget lengthy npm install processes in your build pipeline. This script allows your build pipeline to cache your node_modules in S3 if your package.json hasn't changed.", | ||
@@ -33,3 +33,3 @@ "license": "MIT", | ||
"adm-zip": "^0.4.7", | ||
"aws2js": "^0.8.3", | ||
"aws-sdk": "^2.11.0", | ||
"md5-file": "^3.1.1", | ||
@@ -36,0 +36,0 @@ "q": "^1.4.1", |
@@ -21,3 +21,3 @@ /* | ||
helpers.installNodeModules(packageJsonFileLocation); | ||
console.log('Node modules installed.'); | ||
console.log('Node modules installed. Zipping, please wait...'); | ||
var zipBuffer = helpers.createZip(nodeModulesFolder); | ||
@@ -24,0 +24,0 @@ console.log('Zip created.'); |
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
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
5349
103
0
+ Addedaws-sdk@^2.11.0
+ Addedavailable-typed-arrays@1.0.7(transitive)
+ Addedaws-sdk@2.1692.0(transitive)
+ Addedbase64-js@1.5.1(transitive)
+ Addedbuffer@4.9.2(transitive)
+ Addedcall-bind@1.0.8(transitive)
+ Addedcall-bind-apply-helpers@1.0.1(transitive)
+ Addedcall-bound@1.0.3(transitive)
+ Addeddefine-data-property@1.1.4(transitive)
+ Addeddunder-proto@1.0.1(transitive)
+ Addedes-define-property@1.0.1(transitive)
+ Addedes-errors@1.3.0(transitive)
+ Addedes-object-atoms@1.0.0(transitive)
+ Addedevents@1.1.1(transitive)
+ Addedfor-each@0.3.3(transitive)
+ Addedget-intrinsic@1.2.6(transitive)
+ Addedgopd@1.2.0(transitive)
+ Addedhas-property-descriptors@1.0.2(transitive)
+ Addedhas-symbols@1.1.0(transitive)
+ Addedhas-tostringtag@1.0.2(transitive)
+ Addedieee754@1.1.13(transitive)
+ Addedis-arguments@1.2.0(transitive)
+ Addedis-callable@1.2.7(transitive)
+ Addedis-generator-function@1.0.10(transitive)
+ Addedis-typed-array@1.1.15(transitive)
+ Addedisarray@1.0.0(transitive)
+ Addedjmespath@0.16.0(transitive)
+ Addedmath-intrinsics@1.1.0(transitive)
+ Addedpossible-typed-array-names@1.0.0(transitive)
+ Addedpunycode@1.3.2(transitive)
+ Addedquerystring@0.2.0(transitive)
+ Addedsax@1.2.1(transitive)
+ Addedset-function-length@1.2.2(transitive)
+ Addedurl@0.10.3(transitive)
+ Addedutil@0.12.5(transitive)
+ Addeduuid@8.0.0(transitive)
+ Addedwhich-typed-array@1.1.18(transitive)
- Removedaws2js@^0.8.3
- Removed@mapbox/node-pre-gyp@1.0.11(transitive)
- Removedabbrev@1.1.1(transitive)
- Removedagent-base@6.0.2(transitive)
- Removedansi-regex@5.0.1(transitive)
- Removedaproba@2.0.0(transitive)
- Removedare-we-there-yet@2.0.0(transitive)
- Removedaws2js@0.8.3(transitive)
- Removedbindings@1.3.1(transitive)
- Removedbuffer-concat@1.0.0(transitive)
- Removedchownr@2.0.0(transitive)
- Removedcolor-support@1.1.3(transitive)
- Removedconfig@3.3.12(transitive)
- Removedconsole-control-strings@1.1.0(transitive)
- Removeddebug@4.4.0(transitive)
- Removeddelegates@1.0.0(transitive)
- Removeddetect-libc@2.0.3(transitive)
- Removedemoji-regex@8.0.0(transitive)
- Removedfs-minipass@2.1.0(transitive)
- Removedgauge@3.0.2(transitive)
- Removedhas-unicode@2.0.1(transitive)
- Removedhttps-proxy-agent@5.0.1(transitive)
- Removedis-fullwidth-code-point@3.0.0(transitive)
- Removedjson5@2.2.3(transitive)
- Removedlibxml-to-js@0.3.12(transitive)
- Removedlibxmljs@1.0.11(transitive)
- Removedlodash@4.17.21(transitive)
- Removedmake-dir@3.1.0(transitive)
- Removedmime@4.0.6(transitive)
- Removedmime-magic@5.14.0(transitive)
- Removedminipass@3.3.65.0.0(transitive)
- Removedminizlib@2.1.2(transitive)
- Removedmkdirp@1.0.4(transitive)
- Removedms@2.1.3(transitive)
- Removednan@2.22.0(transitive)
- Removednode-fetch@2.7.0(transitive)
- Removednopt@5.0.0(transitive)
- Removednpmlog@5.0.1(transitive)
- Removedobject-assign@4.1.1(transitive)
- Removedreadable-stream@3.6.2(transitive)
- Removedrimraf@3.0.2(transitive)
- Removedsafe-buffer@5.2.1(transitive)
- Removedsax@1.4.1(transitive)
- Removedsemver@6.3.17.6.3(transitive)
- Removedset-blocking@2.0.0(transitive)
- Removedsignal-exit@3.0.7(transitive)
- Removedstring-width@4.2.3(transitive)
- Removedstring_decoder@1.3.0(transitive)
- Removedstrip-ansi@6.0.1(transitive)
- Removedtar@6.2.1(transitive)
- Removedtr46@0.0.3(transitive)
- Removedutil-deprecate@1.0.2(transitive)
- Removedwebidl-conversions@3.0.1(transitive)
- Removedwhatwg-url@5.0.0(transitive)
- Removedwide-align@1.1.5(transitive)
- Removedyallist@4.0.0(transitive)