{"action":"created","issue":{"url":"https://api.github.com/repos/motdotla/dotenv/issues/96","labels_url":"https://api.github.com/repos/motdotla/dotenv/issues/96/labels{/name}","comments_url":"https://api.github.com/repos/motdotla/dotenv/issues/96/comments","events_url":"https://api.github.com/repos/motdotla/dotenv/issues/96/events","html_url":"https://github.com/motdotla/dotenv/pull/96","id":107945977,"number":96,"title":"Retain parsed variable types.","user":{"login":"aichholzer","id":1402711,"avatar_url":"https://avatars.githubusercontent.com/u/1402711?v=3","gravatar_id":"","url":"https://api.github.com/users/aichholzer","html_url":"https://github.com/aichholzer","followers_url":"https://api.github.com/users/aichholzer/followers","following_url":"https://api.github.com/users/aichholzer/following{/other_user}","gists_url":"https://api.github.com/users/aichholzer/gists{/gist_id}","starred_url":"https://api.github.com/users/aichholzer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aichholzer/subscriptions","organizations_url":"https://api.github.com/users/aichholzer/orgs","repos_url":"https://api.github.com/users/aichholzer/repos","events_url":"https://api.github.com/users/aichholzer/events{/privacy}","received_events_url":"https://api.github.com/users/aichholzer/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-09-23T15:28:17Z","updated_at":"2015-09-24T16:46:06Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/motdotla/dotenv/pulls/96","html_url":"https://github.com/motdotla/dotenv/pull/96","diff_url":"https://github.com/motdotla/dotenv/pull/96.diff","patch_url":"https://github.com/motdotla/dotenv/pull/96.patch"},"body":"The fact that all `.env` variables are parsed as `strings` was annoying me a bit since one would expect that all variables loaded through it are what they should be. In my case, for example, I had something like `LOAD_PHOTOS=false` and then I was trying to use the loaded variable as:\r\n\r\n```\r\nvar loadPhotos = process.env['LOAD_PHOTOS'];\r\nif (!loadPhotos) {\r\n    ...\r\n}\r\n```\r\n\r\nwhich of course never worked, since `loadPhotos = 'false'` and therefore never `!loadPhotos`.\r\n\r\nThis pull request addresses this issue and variables retain their type. Useful, instead of having to write one's own casting logic after `.env` is done loading."},"comment":{"url":"https://api.github.com/repos/motdotla/dotenv/issues/comments/142984131","html_url":"https://github.com/motdotla/dotenv/pull/96#issuecomment-142984131","issue_url":"https://api.github.com/repos/motdotla/dotenv/issues/96","id":142984131,"user":{"login":"maxbeatty","id":93179,"avatar_url":"https://avatars.githubusercontent.com/u/93179?v=3","gravatar_id":"","url":"https://api.github.com/users/maxbeatty","html_url":"https://github.com/maxbeatty","followers_url":"https://api.github.com/users/maxbeatty/followers","following_url":"https://api.github.com/users/maxbeatty/following{/other_user}","gists_url":"https://api.github.com/users/maxbeatty/gists{/gist_id}","starred_url":"https://api.github.com/users/maxbeatty/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maxbeatty/subscriptions","organizations_url":"https://api.github.com/users/maxbeatty/orgs","repos_url":"https://api.github.com/users/maxbeatty/repos","events_url":"https://api.github.com/users/maxbeatty/events{/privacy}","received_events_url":"https://api.github.com/users/maxbeatty/received_events","type":"User","site_admin":false},"created_at":"2015-09-24T16:46:06Z","updated_at":"2015-09-24T16:46:06Z","body":"\"retain\" has been used a few times in this thread and it is misleading. `.env` files are plain text (no types). The parser's job is to identify keys and values and assign them to `process.env` if a value doesn't already exist (with a few other subtleties relating to strings). At that point, `process.env` is just an object that you can manipulate. That's a great point to hand off responsibility to the programmer or another module to alter it as they like (e.g. casting types). This would keep `dotenv` focused and allow another module to expand where it might not make sense for this module (i.e. arrays, objects, sets, and other types)."}}