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

serverless-export-env

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

serverless-export-env - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

src/lib/setEnvVariables.js

2

package.json
{
"name": "serverless-export-env",
"version": "1.0.1",
"version": "1.0.2",
"description": "Serverless plugin to export environment variables into a .env file",

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

@@ -112,2 +112,3 @@ # ⚡️ Serverless Export Env Plugin

* `export-env:resolve` - Resolve CloudFormation references and import variables
* `export-env:apply` - Set environment variables when testing Lambda functions locally
* `export-env:write` - Write environment variables to file

@@ -128,2 +129,5 @@

### 1.0.2
* The plugin now properly resolves and sets the environment variables if a Lambda function is invoked locally (`serverless invoke local -f FUNCTION`). This allows seamless as if the function would be deployed on AWS.
### 1.0.1

@@ -130,0 +134,0 @@ * Corrected plugin naming

@@ -9,2 +9,3 @@ "use strict";

const collectFunctionEnvVariables = require("./lib/collectFunctionEnvVariables");
const setEnvVariables = require("./lib/setEnvVariables");
const collectOfflineEnvVariables = require("./lib/collectOfflineEnvVariables");

@@ -29,2 +30,3 @@ const resolveCloudFormationEnvVariables = require("./lib/resolveCloudFormationEnvVariables");

"resolve",
"apply",
"write"

@@ -39,4 +41,6 @@ ]

"before:offline:start": this.initOfflineHook.bind(this),
"before:invoke:local:invoke": this.initOfflineHook.bind(this),
"export-env:collect": this.collectEnvVars.bind(this),
"export-env:resolve": this.resolveEnvVars.bind(this),
"export-env:apply": this.applyEnvVars.bind(this),
"export-env:write": this.writeEnvVars.bind(this)

@@ -52,4 +56,5 @@ };

this.isOfflineHooked = true;
this.serverless.pluginManager.run([ "export-env" ]);
return this.serverless.pluginManager.run([ "export-env" ]);
}
return BbPromise.resolve();
}

@@ -88,2 +93,11 @@

applyEnvVars() {
return BbPromise.try(() => {
// If this is a local lambda invoke, replace the service environment with the resolved one
if (this.isOfflineHooked) {
setEnvVariables(this.serverless, this.environmentVariables);
}
});
}
writeEnvVars() {

@@ -90,0 +104,0 @@ return BbPromise.try(() => {

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