{"action":"created","issue":{"url":"https://api.github.com/repos/nodejs/node/issues/6123","repository_url":"https://api.github.com/repos/nodejs/node","labels_url":"https://api.github.com/repos/nodejs/node/issues/6123/labels{/name}","comments_url":"https://api.github.com/repos/nodejs/node/issues/6123/comments","events_url":"https://api.github.com/repos/nodejs/node/issues/6123/events","html_url":"https://github.com/nodejs/node/pull/6123","id":147016589,"number":6123,"title":"process: make process.config read-only","user":{"login":"jasnell","id":439929,"avatar_url":"https://avatars.githubusercontent.com/u/439929?v=3","gravatar_id":"","url":"https://api.github.com/users/jasnell","html_url":"https://github.com/jasnell","followers_url":"https://api.github.com/users/jasnell/followers","following_url":"https://api.github.com/users/jasnell/following{/other_user}","gists_url":"https://api.github.com/users/jasnell/gists{/gist_id}","starred_url":"https://api.github.com/users/jasnell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jasnell/subscriptions","organizations_url":"https://api.github.com/users/jasnell/orgs","repos_url":"https://api.github.com/users/jasnell/repos","events_url":"https://api.github.com/users/jasnell/events{/privacy}","received_events_url":"https://api.github.com/users/jasnell/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/nodejs/node/labels/process","name":"process","color":"00aaff"},{"url":"https://api.github.com/repos/nodejs/node/labels/semver-major","name":"semver-major","color":"fbca04"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2016-04-08T19:26:03Z","updated_at":"2016-04-08T23:57:58Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/nodejs/node/pulls/6123","html_url":"https://github.com/nodejs/node/pull/6123","diff_url":"https://github.com/nodejs/node/pull/6123.diff","patch_url":"https://github.com/nodejs/node/pull/6123.patch"},"body":"##### Checklist\r\n\r\n- [x] tests and code linting passes\r\n- [x] a test and/or benchmark is included\r\n- [x] documentation is changed or added\r\n- [x] the commit message follows commit guidelines\r\n\r\n##### Affected core subsystem(s)\r\n\r\nprocess\r\n\r\n##### Description of change\r\n\r\nMakes `process.config` read-only using a getter/setter and freezing the objects on JSON.parse. Does result in a perf hit but `process.config` is not used in any critical paths (or *any* path in core) for that matter. There are apparently some places in user land where this is being extended and it causes problems when we want to add new configuration options (see #6115 for an example).\r\n\r\nRefs: https://github.com/nodejs/node/pull/6115\r\n\r\n/cc @Fishrock123 "},"comment":{"url":"https://api.github.com/repos/nodejs/node/issues/comments/207651147","html_url":"https://github.com/nodejs/node/pull/6123#issuecomment-207651147","issue_url":"https://api.github.com/repos/nodejs/node/issues/6123","id":207651147,"user":{"login":"jasnell","id":439929,"avatar_url":"https://avatars.githubusercontent.com/u/439929?v=3","gravatar_id":"","url":"https://api.github.com/users/jasnell","html_url":"https://github.com/jasnell","followers_url":"https://api.github.com/users/jasnell/followers","following_url":"https://api.github.com/users/jasnell/following{/other_user}","gists_url":"https://api.github.com/users/jasnell/gists{/gist_id}","starred_url":"https://api.github.com/users/jasnell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jasnell/subscriptions","organizations_url":"https://api.github.com/users/jasnell/orgs","repos_url":"https://api.github.com/users/jasnell/repos","events_url":"https://api.github.com/users/jasnell/events{/privacy}","received_events_url":"https://api.github.com/users/jasnell/received_events","type":"User","site_admin":false},"created_at":"2016-04-08T23:57:58Z","updated_at":"2016-04-08T23:57:58Z","body":"Yep, this one is going to be just a bit problematic. There are a handful of modules that mutate `process.config`... for instance: https://github.com/falsecz/cson-config/blob/master/index.coffee\r\n\r\nSalem (https://www.npmjs.com/package/salem) is a good example. Take a look at the example given:\r\n\r\n```js\r\nvar salem = require('salem');\r\nvar configClient = salem.createClient({\r\n  url: 'http://localhost:8080',\r\n  env: process.env.NODE_ENV || 'development'\r\n});\r\n \r\n// \r\n// Load the configuration for use within the application. \r\n// \r\nconfigClient.loadConfig(function (err, config) {\r\n  if (err) throw err;\r\n  process.config = config;\r\n});\r\n```\r\n\r\nSome of these add keys to the `process.config`, others replace it outright... which is obviously problematic if we're going to be depending on it in any way.\r\n\r\nDigging in further... It also looks like this could break node-gyp which does some stuff with process.config internally.\r\n"}}