New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

serverless-dotenv-plugin

Package Overview
Dependencies
Maintainers
2
Versions
46
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

serverless-dotenv-plugin - npm Package Compare versions

Comparing version 3.7.1 to 3.7.2

2

package.json
{
"name": "serverless-dotenv-plugin",
"version": "3.7.1",
"version": "3.7.2",
"description": "Preload environment variables with dotenv into serverless.",

@@ -5,0 +5,0 @@ "main": "src/index.js",

@@ -18,15 +18,16 @@ 'use strict'

this.serverless.service.provider.environment || {}
this.config =
this.serverless.service.custom && this.serverless.service.custom['dotenv']
this.logging =
this.config && typeof this.config.logging !== 'undefined'
? this.config.logging
: true
this.required = (this.config && this.config.required) || {}
this.variableExpansion = !(
(this.config && this.config.variableExpansion) === false
this.config = Object.assign(
{
logging: true,
required: {},
variableExpansion: true,
},
(this.serverless.service.custom &&
this.serverless.service.custom['dotenv']) ||
{},
)
if (this.config && this.config.dotenvParser) {
this.dotenvParserPath = path.join(
if (this.config.dotenvParser) {
this.config.dotenvParserPath = path.join(
serverless.config.servicePath,

@@ -41,3 +42,3 @@ this.config.dotenvParser,

log(...args) {
if (this.logging) {
if (this.config.logging) {
this.serverless.cli.log(...args)

@@ -95,3 +96,6 @@ }

try {
return require(this.dotenvParserPath)({ dotenv, paths: envFileNames })
return require(this.config.dotenvParserPath)({
dotenv,
paths: envFileNames,
})
} catch (err) {

@@ -109,3 +113,3 @@ throw Object.assign(err, { type: errorTypes.HALT })

const parsed = dotenv.config({ path: fileName })
return this.variableExpansion
return this.config.variableExpansion
? dotenvExpand(parsed).parsed

@@ -163,3 +167,3 @@ : parsed.parsed

if (this.required.file === true) {
if (this.config.required.file === true) {
throw Object.assign(new Error(errorMsg), { type: errorTypes.HALT })

@@ -183,3 +187,3 @@ }

const missingRequiredEnvVars = (this.required.env || []).filter(
const missingRequiredEnvVars = (this.config.required.env || []).filter(
(envVarName) => !envVars[envVarName] && !process.env[envVarName],

@@ -208,3 +212,3 @@ )

const envVars = this.dotenvParserPath
const envVars = this.config.dotenvParserPath
? this.callDotenvParser(envFileNames)

@@ -211,0 +215,0 @@ : this.parseEnvFiles(envFileNames)

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