Socket
Socket
Sign inDemoInstall

@acryps/environment

Package Overview
Dependencies
Maintainers
3
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@acryps/environment

Environment variable manager for local development


Version published
Weekly downloads
253
decreased by-30.49%
Maintainers
3
Weekly downloads
 
Created
Source

acryps environment

Environment variable manager for local development

Getting Started

npm install @acryps/environment --save-dev

Active environment by adding environment before launching your application in your scripts (will work with any tool)

tsc && node index.jstsc && environment node index.js

Define environment variables in your package.json

{
	"name": "my-application",
	"environment": {
		"host": "Application Host",
		"database": {
			"host": "Database Host",
			"+port?5432": "Database Port"
		}
	}
}

You'll automatically be prompted to enter the values required for your project. The following environment variables will automatically be passed as environment variables to the application launched by environment:

  • HOST
  • DATABASE_HOST
  • DATABASE_PORT

Access them as usual with process.env.HOST - no changes to the code required.

Modifiers

Modifiers may be added to the names in the package configuration

  • …?default: Set a default value which will be accepted when the user does not provide a value
  • +…: Require a numeric value

Adding an uppercase letter in the variables name will automatically be expanded with a _: accessKeyACCESS_KEY

Exporting

The current configuration can be exported in various formats for import into other applications

npx environment --export # exports as environment bundle, for import into environment
npx environment --export-json # exports as json
npx environment --export-shell # exports as NAME="VALUE" statements for shell scripts
npx environment --export-dotenv # exports as export NAME="VALUE" statements for .env files
npx environment --export-cluster # exports as vlcluster variable commands
npx environment --export-kubernetes # exports as kubernetes deployment configuration values

FAQs

Package last updated on 11 Oct 2023

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

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