
Company News
Socket Named Top Sales Organization by RepVue
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.
This module helps normalise your environment variables. It is part of the moped suite of utilities for creating composable configs for building node.js and react apps.
This module helps normalise your environment variables. It is part of the moped suite of utilities for creating composable configs for building node.js and react apps.
You must load env before all other modules.
yarn add --dev @moped/env
If you want your users to specify NODE_ENV manually:
import '@moped/env/auto';
import * as webpack from 'webpack;
In your build file:
import '@moped/env/production';
import * as webpack from 'webpack;
In your tests:
import '@moped/env/test';
import * as webpack from 'webpack;
In development:
import '@moped/env/development';
import * as webpack from 'webpack;
If you want your users to specify NODE_ENV manually:
require('@moped/env/auto');
const webpack = require('webpack');
In your build file:
require('@moped/env/production');
const webpack = require('webpack');
In your tests:
require('@moped/env/test');
const webpack = require('webpack');
In development:
require('@moped/env/development');
const webpack = require('webpack');
Once you are using @moped/env, you can configure your environment using .env files. You should make sure the following is included in your .gitignore file:
.env.local
.env.development.local
.env.test.local
.env.production.local
When reading an environment variable, @moped/env will first look in the actual environment, then .env.{NODE_ENV}.local, then .env.{NODE_ENV}, then .env.local then .env. You use .env for config shared amongst all environments/for setting up a default config. You can use the .local variants for confidential configuration that you don't want published to GitHub, and you can use the {NODE_ENV} variants to override config in different environments.
You should always try to ensure your app at least runs with no .local config, as this will make it easier to onboard new team members.
MIT
FAQs
This module helps normalise your environment variables. It is part of the moped suite of utilities for creating composable configs for building node.js and react apps.
We found that @moped/env 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.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.