Comparing version 0.1.1 to 0.2.0
60
index.js
@@ -1,61 +0,3 @@ | ||
var dotenv = require("dotenv").config() | ||
module.exports = require("./loader.js").load() | ||
if (process.env.ENVKEY){ | ||
var ffi = require("ffi"), | ||
path = require('path') | ||
var platform = process.platform, | ||
arch = process.arch, | ||
isUnix = platform != "win32", | ||
platformParts, | ||
lib | ||
if (!isUnix){ | ||
throw "Envkey currently only supports linux and OSX" | ||
} else if (platform == "darwin"){ | ||
platformParts = arch == "x64" ? ["darwin-10.6-amd64"] : ["darwin-10.6-386"] | ||
} else { | ||
if (arch == "x64"){ | ||
platformParts = ["linux-amd64", "linux-arm64"] | ||
} else if (arch == "ia32"){ | ||
platformParts = ["linux-386"] | ||
} else { | ||
platformParts = ["linux-arm64", "linux-arm-7", "linux-arm-6", "linux-arm-5"] | ||
} | ||
} | ||
for (var i = 0; i < platformParts.length; i++) { | ||
var part = platformParts[i], | ||
libPath = path.join(process.cwd(), "node_modules", "envkey", "ext", ["envkey", part].join("-")) | ||
try { | ||
lib = ffi.Library(libPath, { | ||
EnvJson: ['string', ['string']] | ||
}) | ||
break | ||
} catch (e) { | ||
continue | ||
} | ||
} | ||
if(!lib){ | ||
throw "There was a problem loading Evkey on your platform" | ||
} | ||
try { | ||
var res = lib.EnvJson(process.env.ENVKEY) | ||
json = JSON.parse(res) | ||
for (k in json){ | ||
if(!process.env[k]){ | ||
process.env[k] = json[k] | ||
} | ||
} | ||
console.log("ENVKEY: vars loaded and decrypted - access with process.env.YOUR_VAR_NAME") | ||
} catch (e) { | ||
throw "Envkey invalid. Couldn't load vars." | ||
} | ||
} | ||
{ | ||
"name": "envkey", | ||
"version": "0.1.1", | ||
"version": "0.2.0", | ||
"description": "Envkey secures and simplifies app secrets and config by storing it in an encrypted vault and granting access to developers and servers.", | ||
@@ -18,2 +18,3 @@ "main": "index.js", | ||
"dependencies": { | ||
"command-line-args": "^4.0.2", | ||
"dotenv": "^4.0.0", | ||
@@ -20,0 +21,0 @@ "ffi": "^2.2.0" |
AI-detected possible typosquat
Supply chain riskAI has identified this package as a potential typosquat of a more popular package. This suggests that the package may be intentionally mimicking another package's name, description, or other metadata.
Found 1 instance in 1 package
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
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
48077793
23
237
4
3
14
+ Addedcommand-line-args@^4.0.2
+ Addedarray-back@1.0.42.0.0(transitive)
+ Addedcommand-line-args@4.0.7(transitive)
+ Addedfind-replace@1.0.3(transitive)
+ Addedtest-value@2.1.0(transitive)
+ Addedtypical@2.6.1(transitive)