
Research
/Security News
Toptal’s GitHub Organization Hijacked: 10 Malicious Packages Published
Threat actors hijacked Toptal’s GitHub org, publishing npm packages with malicious payloads that steal tokens and attempt to wipe victim systems.
serverless-env-vars
Advanced tools
Run your scripts using the same environment variables that are loaded by serverless.
# NPM
npm i --save-dev serverless-env-vars
# Yarn
yarn --dev severless-env-vars
The main usage of this library will be to run it on the CLI, it will create a child process for your commands
that are configured with {...process.env, ...serverlessEnvVars}
as the environment.
# Run npm run build with serverless-set environment variables
serverless-env-vars npm run build
# Configure the stage
STAGE=prod serverless-env-vars ...
There is an exposed node API if that's more your thing. The CLI is a yargs
-based wrapper around this function.
export type RunWithEnvVarsOptions = {
readonly cmd: string
readonly args: readonly string[]
readonly watch?: boolean
readonly log?: boolean
readonly logStages?: readonly string[]
readonly stage?: string
}
Retrieve the configuration of your local serverless setup. If a configuration can not be found or parsed this will throw.
import { getConfiguration } from 'serverless-env-vars'
async function example() {
const { configurationPath, configuration } = await getConfiguration()
}
Easily create a Serverless instance.
import { createServerless } from 'serverless-env-vars'
async function example() {
// Stage is optional
// Stage can be configured via the environment variable STAGE
const serverless = await createServerless({ stage: 'prod' })
}
Get environment variables for your local serverless configuration.
import { getEnvVars } from 'serverless-env-vars'
async function example() {
// Stage is optional
// Stage can be configured via the environment variable STAGE
const envVars = await getEnvVars({ stage: 'prod' })
}
Set the environment variables within process.env
FAQs
Run your node scripts with the same variables loaded by serverless
The npm package serverless-env-vars receives a total of 3 weekly downloads. As such, serverless-env-vars popularity was classified as not popular.
We found that serverless-env-vars demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
/Security News
Threat actors hijacked Toptal’s GitHub org, publishing npm packages with malicious payloads that steal tokens and attempt to wipe victim systems.
Research
/Security News
Socket researchers investigate 4 malicious npm and PyPI packages with 56,000+ downloads that install surveillance malware.
Security News
The ongoing npm phishing campaign escalates as attackers hijack the popular 'is' package, embedding malware in multiple versions.