Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option 'proc': when set to false it will not modify process.env. #170

Closed
wants to merge 1 commit into from

Conversation

ckiickA
Copy link

@ckiickA ckiickA commented Jan 5, 2017

Sometimes you want to only read in environment variables without modifying process.env. This is useful when reading a .env file prior to spawning a new process, for example. The 'proc' option defaults to true. If set to false, it will not modify process.env, just return the parsed object.

@coveralls
Copy link

coveralls commented Jan 5, 2017

Coverage Status

Coverage decreased (-3.7%) to 96.296% when pulling 1ef00c8 on ckiickA:master into 825c1b2 on motdotla:master.

@maxbeatty
Copy link
Contributor

the parse method is exposed to do just that

const fs = require('fs')
const dotenv = require('dotenv')
const parsedObj = dotenv.parse(fs.readFileSync('.env', { encoding: 'utf8' }))

@maxbeatty maxbeatty closed this Jan 6, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants