
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
Read environment variables from process.env (.env) as convenient nested object.
Store objects and arrays as string variables.
# with npm
npm install fine-env
# or with yarn
yarn add fine-env
const env = require('fine-env');
// getting environment vars from env object
// get PORT
const port = env.port;
// get MONGODB_URL
const mongodbUrl = env.mongodbUrl;
// get GOOGLE__APP_1__CLIENT_ID and GOOGLE__APP1__CLIENT_SECRET
const { clientId, clientSecret } = env.google.app1;
// or use original keys
const { CLIENT_ID, CLIENT_SECRET } = env.google.app1;
// get SystemRoot
const { SystemRoot } = env;
// or use camelCase style
const { systemRoot } = env;
// get all vars with prefix GOOGLE__
const { google } = env;
// or with require
const { google } = require('fine-env');
// get ROOT_VAR__parentVar__child_Var
const { childVar } = env.rootVar.parentVar;
// get _INIT_UTS__PLATFORM and _INIT_UTS__RELEASE
const db = env.db;
const { platform, release } = env._initUts;
FOO__BAR__=111,222,333,444,555
ALLOWED_HOSTS__=localhost,example.com,*.example.com
const env = require('fine-env');
console.log(env.foo.bar); // => [111, 222, 333, 444, 555]
console.log(env.allowedHosts); // => ['localhost', 'example.com', '*.example.com']
MIT
FAQs
Convert environment vars to convenient nested object.
We found that fine-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.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.