dynamodb-localhost
Advanced tools
Comparing version 0.0.8 to 0.0.9
{ | ||
"setup": { | ||
"download_url": "http://s3-us-west-2.amazonaws.com/dynamodb-local/dynamodb_local_latest.tar.gz", | ||
"install_path": "./bin", | ||
"jar": "DynamoDBLocal.jar" | ||
}, | ||
"start": { | ||
"port": 8000 | ||
} | ||
"setup": { | ||
"download_url": "http://s3-us-west-2.amazonaws.com/dynamodb-local/dynamodb_local_latest.tar.gz", | ||
"install_path": "bin", | ||
"jar": "DynamoDBLocal.jar" | ||
}, | ||
"start": { | ||
"port": 8000 | ||
} | ||
} |
@@ -1,62 +0,75 @@ | ||
'use strict'; | ||
"use strict"; | ||
var tar = require('tar'), | ||
zlib = require('zlib'), | ||
path = require('path'), | ||
http = require('http'), | ||
fs = require('fs'), | ||
ProgressBar = require('progress'), | ||
utils = require('./utils'); | ||
var tar = require("tar"), | ||
zlib = require("zlib"), | ||
path = require("path"), | ||
http = require("http"), | ||
fs = require("fs"), | ||
ProgressBar = require("progress"), | ||
utils = require("./utils"); | ||
var download = function (downloadUrl, installPath, callback) { | ||
console.log("Started downloading Dynamodb-local. Process may take few minutes."); | ||
http.get(downloadUrl, function (response) { | ||
var len = parseInt(response.headers['content-length'], 10), | ||
bar = new ProgressBar('Downloading dynamodb-local [:bar] :percent :etas', { | ||
complete: '=', | ||
incomplete: ' ', | ||
width: 40, | ||
total: len | ||
}); | ||
var download = function(downloadUrl, installPath, callback) { | ||
console.log( | ||
`Started downloading dynamodb-local from ${downloadUrl} into ${installPath}. Process may take few minutes.` | ||
); | ||
http | ||
.get(downloadUrl, function(response) { | ||
var len = parseInt(response.headers["content-length"], 10), | ||
bar = new ProgressBar( | ||
"Downloading dynamodb-local [:bar] :percent :etas", | ||
{ | ||
complete: "=", | ||
incomplete: " ", | ||
width: 40, | ||
total: len | ||
} | ||
); | ||
if (200 != response.statusCode) { | ||
throw new Error('Error getting DynamoDb local latest tar.gz location ' + response.headers.location + ': ' + response.statusCode); | ||
} | ||
if (200 != response.statusCode) { | ||
throw new Error( | ||
"Error getting DynamoDb local latest tar.gz location " + | ||
response.headers.location + | ||
": " + | ||
response.statusCode | ||
); | ||
} | ||
response | ||
.pipe(zlib.Unzip()) | ||
.pipe(tar.Extract({ | ||
path: installPath | ||
})) | ||
.on('data', function (chunk) { | ||
bar.tick(chunk.length); | ||
}) | ||
.on('end', function () { | ||
callback("\n Installation complete!"); | ||
}) | ||
.on('error', function (err) { | ||
throw new Error("Error in downloading Dynamodb local " + err); | ||
}); | ||
}) | ||
.on('error', function (err) { | ||
throw new Error("Error in downloading Dynamodb local " + err); | ||
response | ||
.pipe(zlib.Unzip()) | ||
.pipe( | ||
tar.x({ | ||
C: installPath | ||
}) | ||
) | ||
.on("data", function(chunk) { | ||
bar.tick(chunk.length); | ||
}) | ||
.on("end", function() { | ||
callback("\n Installation complete!"); | ||
}) | ||
.on("error", function(err) { | ||
throw new Error("Error in downloading Dynamodb local " + err); | ||
}); | ||
}) | ||
.on("error", function(err) { | ||
throw new Error("Error in downloading Dynamodb local " + err); | ||
}); | ||
}; | ||
var install = function (config, callback) { | ||
var install_path = utils.absPath(config.setup.install_path), | ||
jar = config.setup.jar, | ||
download_url = config.setup.download_url; | ||
var install = function(config, callback) { | ||
var install_path = utils.absPath(config.setup.install_path), | ||
jar = config.setup.jar, | ||
download_url = config.setup.download_url; | ||
try { | ||
if (fs.existsSync(path.join(install_path, jar))) { | ||
callback("Dynamodb is already installed on path!"); | ||
} else { | ||
utils.createDir(config.setup.install_path); | ||
download(download_url, install_path, callback); | ||
} | ||
} catch (err) { | ||
throw new Error("Error configuring or installing Dynamodb local " + err); | ||
try { | ||
if (fs.existsSync(path.join(install_path, jar))) { | ||
callback("Dynamodb is already installed on path!"); | ||
} else { | ||
utils.createDir(config.setup.install_path); | ||
download(download_url, install_path, callback); | ||
} | ||
} catch (err) { | ||
throw new Error("Error configuring or installing Dynamodb local " + err); | ||
} | ||
}; | ||
module.exports.install = install; |
{ | ||
"name": "dynamodb-localhost", | ||
"version": "0.0.8", | ||
"version": "0.0.9", | ||
"engines": { | ||
@@ -28,5 +28,9 @@ "node": ">=4.0" | ||
"main": "index.js", | ||
"bin": {}, | ||
"scripts": { | ||
"test": "mocha test/*.test.js --reporter spec" | ||
}, | ||
"dependencies": { | ||
"chai": "^4.2.0", | ||
"mkdirp": "^0.5.0", | ||
"mocha": "^6.1.4", | ||
"progress": "^1.1.8", | ||
@@ -33,0 +37,0 @@ "rimraf": "^2.6.3", |
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
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
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
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
18334
11
235
6
4
+ Addedchai@^4.2.0
+ Addedmocha@^6.1.4
+ Addedansi-colors@3.2.3(transitive)
+ Addedansi-regex@3.0.14.1.1(transitive)
+ Addedansi-styles@3.2.1(transitive)
+ Addedargparse@1.0.10(transitive)
+ Addedarray-buffer-byte-length@1.0.1(transitive)
+ Addedarray.prototype.reduce@1.0.7(transitive)
+ Addedarraybuffer.prototype.slice@1.0.3(transitive)
+ Addedassertion-error@1.1.0(transitive)
+ Addedavailable-typed-arrays@1.0.7(transitive)
+ Addedbrowser-stdout@1.3.1(transitive)
+ Addedcall-bind@1.0.7(transitive)
+ Addedcamelcase@5.3.1(transitive)
+ Addedchai@4.5.0(transitive)
+ Addedchalk@2.4.2(transitive)
+ Addedcheck-error@1.0.3(transitive)
+ Addedcliui@5.0.0(transitive)
+ Addedcolor-convert@1.9.3(transitive)
+ Addedcolor-name@1.1.3(transitive)
+ Addeddata-view-buffer@1.0.1(transitive)
+ Addeddata-view-byte-length@1.0.1(transitive)
+ Addeddata-view-byte-offset@1.0.0(transitive)
+ Addeddebug@3.2.6(transitive)
+ Addeddecamelize@1.2.0(transitive)
+ Addeddeep-eql@4.1.4(transitive)
+ Addeddefine-data-property@1.1.4(transitive)
+ Addeddefine-properties@1.2.1(transitive)
+ Addeddiff@3.5.0(transitive)
+ Addedemoji-regex@7.0.3(transitive)
+ Addedes-abstract@1.23.3(transitive)
+ Addedes-array-method-boxes-properly@1.0.0(transitive)
+ Addedes-define-property@1.0.0(transitive)
+ Addedes-errors@1.3.0(transitive)
+ Addedes-object-atoms@1.0.0(transitive)
+ Addedes-set-tostringtag@2.0.3(transitive)
+ Addedes-to-primitive@1.2.1(transitive)
+ Addedescape-string-regexp@1.0.5(transitive)
+ Addedesprima@4.0.1(transitive)
+ Addedfind-up@3.0.0(transitive)
+ Addedflat@4.1.1(transitive)
+ Addedfor-each@0.3.3(transitive)
+ Addedfunction-bind@1.1.2(transitive)
+ Addedfunction.prototype.name@1.1.6(transitive)
+ Addedfunctions-have-names@1.2.3(transitive)
+ Addedget-caller-file@2.0.5(transitive)
+ Addedget-func-name@2.0.2(transitive)
+ Addedget-intrinsic@1.2.4(transitive)
+ Addedget-symbol-description@1.0.2(transitive)
+ Addedglob@7.1.3(transitive)
+ Addedglobalthis@1.0.4(transitive)
+ Addedgopd@1.0.1(transitive)
+ Addedgrowl@1.10.5(transitive)
+ Addedhas-bigints@1.0.2(transitive)
+ Addedhas-flag@3.0.0(transitive)
+ Addedhas-property-descriptors@1.0.2(transitive)
+ Addedhas-proto@1.0.3(transitive)
+ Addedhas-symbols@1.0.3(transitive)
+ Addedhas-tostringtag@1.0.2(transitive)
+ Addedhasown@2.0.2(transitive)
+ Addedhe@1.2.0(transitive)
+ Addedinternal-slot@1.0.7(transitive)
+ Addedis-array-buffer@3.0.4(transitive)
+ Addedis-bigint@1.0.4(transitive)
+ Addedis-boolean-object@1.1.2(transitive)
+ Addedis-buffer@2.0.5(transitive)
+ Addedis-callable@1.2.7(transitive)
+ Addedis-data-view@1.0.1(transitive)
+ Addedis-date-object@1.0.5(transitive)
+ Addedis-fullwidth-code-point@2.0.0(transitive)
+ Addedis-negative-zero@2.0.3(transitive)
+ Addedis-number-object@1.0.7(transitive)
+ Addedis-regex@1.1.4(transitive)
+ Addedis-shared-array-buffer@1.0.3(transitive)
+ Addedis-string@1.0.7(transitive)
+ Addedis-symbol@1.0.4(transitive)
+ Addedis-typed-array@1.1.13(transitive)
+ Addedis-weakref@1.0.2(transitive)
+ Addedisarray@2.0.5(transitive)
+ Addedisexe@2.0.0(transitive)
+ Addedjs-yaml@3.13.1(transitive)
+ Addedlocate-path@3.0.0(transitive)
+ Addedlodash@4.17.21(transitive)
+ Addedlog-symbols@2.2.0(transitive)
+ Addedloupe@2.3.7(transitive)
+ Addedminimatch@3.0.4(transitive)
+ Addedmkdirp@0.5.4(transitive)
+ Addedmocha@6.2.3(transitive)
+ Addedms@2.1.1(transitive)
+ Addednode-environment-flags@1.0.5(transitive)
+ Addedobject-inspect@1.13.3(transitive)
+ Addedobject-keys@1.1.1(transitive)
+ Addedobject.assign@4.1.04.1.5(transitive)
+ Addedobject.getownpropertydescriptors@2.1.8(transitive)
+ Addedp-limit@2.3.0(transitive)
+ Addedp-locate@3.0.0(transitive)
+ Addedp-try@2.2.0(transitive)
+ Addedpath-exists@3.0.0(transitive)
+ Addedpathval@1.1.1(transitive)
+ Addedpossible-typed-array-names@1.0.0(transitive)
+ Addedregexp.prototype.flags@1.5.3(transitive)
+ Addedrequire-directory@2.1.1(transitive)
+ Addedrequire-main-filename@2.0.0(transitive)
+ Addedsafe-array-concat@1.1.2(transitive)
+ Addedsafe-regex-test@1.0.3(transitive)
+ Addedsemver@5.7.2(transitive)
+ Addedset-blocking@2.0.0(transitive)
+ Addedset-function-length@1.2.2(transitive)
+ Addedset-function-name@2.0.2(transitive)
+ Addedside-channel@1.0.6(transitive)
+ Addedsprintf-js@1.0.3(transitive)
+ Addedstring-width@2.1.13.1.0(transitive)
+ Addedstring.prototype.trim@1.2.9(transitive)
+ Addedstring.prototype.trimend@1.0.8(transitive)
+ Addedstring.prototype.trimstart@1.0.8(transitive)
+ Addedstrip-ansi@4.0.05.2.0(transitive)
+ Addedstrip-json-comments@2.0.1(transitive)
+ Addedsupports-color@5.5.06.0.0(transitive)
+ Addedtype-detect@4.1.0(transitive)
+ Addedtyped-array-buffer@1.0.2(transitive)
+ Addedtyped-array-byte-length@1.0.1(transitive)
+ Addedtyped-array-byte-offset@1.0.2(transitive)
+ Addedtyped-array-length@1.0.6(transitive)
+ Addedunbox-primitive@1.0.2(transitive)
+ Addedwhich@1.3.1(transitive)
+ Addedwhich-boxed-primitive@1.0.2(transitive)
+ Addedwhich-module@2.0.1(transitive)
+ Addedwhich-typed-array@1.1.15(transitive)
+ Addedwide-align@1.1.3(transitive)
+ Addedwrap-ansi@5.1.0(transitive)
+ Addedy18n@4.0.3(transitive)
+ Addedyargs@13.3.2(transitive)
+ Addedyargs-parser@13.1.2(transitive)
+ Addedyargs-unparser@1.6.0(transitive)
- Removedglob@7.2.3(transitive)
- Removedminimatch@3.1.2(transitive)