hughsk / envify

:wrench: Selectively replace Node-style environment variables with plain strings.
902 stars 57 forks source link

Is there a way to specify a custom object? #36

Closed mbrevda closed 8 years ago

mbrevda commented 8 years ago

Let's say I'd rather not pollute my process.env. Is there a way to specify my own, custom, object to be operated on?

yoshuawuyts commented 8 years ago

Yup, from the docs:

b.transform(envify({
  NODE_ENV: 'development'
}))
b.bundle().pipe(output)

cheers! :sparkles:

mbrevda commented 8 years ago

I'm not sure I was clear. Instead of searching for process.env.myVar, I'd like to search for foo.myVar.

yoshuawuyts commented 8 years ago

Oh no can't do, that's not within the feature scope of this package. You should probably write your own transform for that. Cheers!

mbrevda commented 8 years ago

Thanks