{"action":"created","issue":{"url":"https://api.github.com/repos/NodeBB/NodeBB/issues/1529","labels_url":"https://api.github.com/repos/NodeBB/NodeBB/issues/1529/labels{/name}","comments_url":"https://api.github.com/repos/NodeBB/NodeBB/issues/1529/comments","events_url":"https://api.github.com/repos/NodeBB/NodeBB/issues/1529/events","html_url":"https://github.com/NodeBB/NodeBB/issues/1529","id":33539009,"number":1529,"title":"[Settings] Make getting settings less complicated","user":{"login":"psychobunny","id":654670,"avatar_url":"https://avatars.githubusercontent.com/u/654670?v=3","gravatar_id":"","url":"https://api.github.com/users/psychobunny","html_url":"https://github.com/psychobunny","followers_url":"https://api.github.com/users/psychobunny/followers","following_url":"https://api.github.com/users/psychobunny/following{/other_user}","gists_url":"https://api.github.com/users/psychobunny/gists{/gist_id}","starred_url":"https://api.github.com/users/psychobunny/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/psychobunny/subscriptions","organizations_url":"https://api.github.com/users/psychobunny/orgs","repos_url":"https://api.github.com/users/psychobunny/repos","events_url":"https://api.github.com/users/psychobunny/events{/privacy}","received_events_url":"https://api.github.com/users/psychobunny/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2014-05-14T22:24:13Z","updated_at":"2015-02-28T11:04:12Z","closed_at":null,"body":"So I finally got a chance to play with the new settings framework @frissdiegurke, here are my thoughts:\r\n\r\n\r\nSee https://github.com/designcreateplay/NodeBB/blob/master/src/meta.js#L391-L394\r\n\r\nI think would be great if we can convert the syntax to something like:\r\n\r\n```\r\nvar settings = require('./settings');\r\nsettings.get('branding', function(err, branding) {\r\n    branding; // this is branding.cfg._ in the current code\r\n});\r\n```\r\n\r\nSo in other words, \r\n\r\n1. make `version` and `default config` optional parameters\r\n2. callback should be `function(err, object, otherConfigurations)`\r\n3. don't use `new` syntax, we try to avoid that in NodeBB in general so this would kind of break style (sort of an unwritten rule)\r\n\r\n\r\nIf that's too overwhelming for you @frissdiegurke I can take a crack at it, but would need to familiarize myself with the more complex settings plugins first.\r\n\r\n<bountysource-plugin>\r\n\r\n---\r\nWant to back this issue? **[Place a bounty on it!](https://www.bountysource.com/issues/2166087-settings-make-getting-settings-less-complicated?utm_campaign=plugin&utm_content=tracker%2F282529&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F282529&utm_medium=issues&utm_source=github).\r\n</bountysource-plugin>"},"comment":{"url":"https://api.github.com/repos/NodeBB/NodeBB/issues/comments/76521594","html_url":"https://github.com/NodeBB/NodeBB/issues/1529#issuecomment-76521594","issue_url":"https://api.github.com/repos/NodeBB/NodeBB/issues/1529","id":76521594,"user":{"login":"pitaj","id":803701,"avatar_url":"https://avatars.githubusercontent.com/u/803701?v=3","gravatar_id":"","url":"https://api.github.com/users/pitaj","html_url":"https://github.com/pitaj","followers_url":"https://api.github.com/users/pitaj/followers","following_url":"https://api.github.com/users/pitaj/following{/other_user}","gists_url":"https://api.github.com/users/pitaj/gists{/gist_id}","starred_url":"https://api.github.com/users/pitaj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pitaj/subscriptions","organizations_url":"https://api.github.com/users/pitaj/orgs","repos_url":"https://api.github.com/users/pitaj/repos","events_url":"https://api.github.com/users/pitaj/events{/privacy}","received_events_url":"https://api.github.com/users/pitaj/received_events","type":"User","site_admin":false},"created_at":"2015-02-28T11:04:12Z","updated_at":"2015-02-28T11:04:12Z","body":"Is this still a thing?"}}