New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

env-populate

Package Overview
Dependencies
Maintainers
0
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

env-populate

CLI tool to scan .env.example files, populate placeholders, and generate .env.local files.

latest
npmnpm
Version
0.3.1
Version published
Maintainers
0
Created
Source

env-populate

env-populate is a simple command line utility that traverses a directory to located .env.example files and creates .env files with the same content, but with placeholder values replaced with values from environment variables. env-populate has native support for Supabase environment variables using the supabase status. See the list of support placeholder names below.

Installation

Use NPM to install env-populate globally.

npm install -g env-populate

Usage

env-populate fill [options] [dir]

Example

env-populate fill ./apps

Build-in Placeholder Names

  • <supabase-url>: The Supabase API URL.
  • <supabase-anon-key>: The anonymous key of the Supabase project.
  • <supabase-service-role-key>: The service key of the Supabase project.
  • <supabase-db-url>: The URL of the Supabase database.
  • <supabase-graphql-url>: The URL of the Supabase GraphQL API.
  • <host-ip>: The IP address of the host machine.

Any of these placeholder names can be overridden using the --values option (see description below).

Custom Placeholder Names

Custom placeholder names can be used in .env.example files. These can be overridden using the --values option followed by a comma separated list (spaces not allowed).

env-populate populate --values placeholder1=value1,placeholder2=value2

It is possible to override build-in placeholder names using the --values option.

env-populate populate --values supabase-service-role-key=mySuperSecretKey

Fill

The fill command is used to populate .env files in a directory. The command traverses the directory to locate .env.example files and creates .env files with the same content, but with placeholder values replaced with values from environment variables.

env-populate fill [options] [dir]
OptionDescription
--valuesA comma separated list of placeholder values.
--varsA comma separated list of environment variables to add.
-o --outThe filename of the .env file to generate in each directory. The default is .env.local
--overrideBy default, env-populate will merge environment variables into the existing .env file. This option will force the entire file to be overridden.
--no-mergeDo not merge environment variables into the existing .env file. This option will skip .env files that already exist without merging in new variables.
--verboseDisplay additional information.
--ignoreA comma separated list of patterns for directories to ignore.
--silentDo not display any output. This option will override --verbose option.
--dry-runDo not write .env files.
-h --helpDisplay help for the command.
v --versionDisplay the version of the command.

FAQs

Package last updated on 20 Jan 2025

Did you know?

Socket

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.

Install

Related posts