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

s3-npm-cache

Package Overview
Dependencies
Maintainers
1
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

s3-npm-cache - npm Package Compare versions

Comparing version 0.0.11 to 0.0.12

32

helpers.js

@@ -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.');

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