{"action":"closed","issue":{"url":"https://api.github.com/repos/json5/json5/issues/174","repository_url":"https://api.github.com/repos/json5/json5","labels_url":"https://api.github.com/repos/json5/json5/issues/174/labels{/name}","comments_url":"https://api.github.com/repos/json5/json5/issues/174/comments","events_url":"https://api.github.com/repos/json5/json5/issues/174/events","html_url":"https://github.com/json5/json5/issues/174","id":320412383,"number":174,"title":"delete require.cache does not work","user":{"login":"alhaag","id":7332467,"avatar_url":"https://avatars1.githubusercontent.com/u/7332467?v=4","gravatar_id":"","url":"https://api.github.com/users/alhaag","html_url":"https://github.com/alhaag","followers_url":"https://api.github.com/users/alhaag/followers","following_url":"https://api.github.com/users/alhaag/following{/other_user}","gists_url":"https://api.github.com/users/alhaag/gists{/gist_id}","starred_url":"https://api.github.com/users/alhaag/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alhaag/subscriptions","organizations_url":"https://api.github.com/users/alhaag/orgs","repos_url":"https://api.github.com/users/alhaag/repos","events_url":"https://api.github.com/users/alhaag/events{/privacy}","received_events_url":"https://api.github.com/users/alhaag/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":{"login":"jordanbtucker","id":468153,"avatar_url":"https://avatars1.githubusercontent.com/u/468153?v=4","gravatar_id":"","url":"https://api.github.com/users/jordanbtucker","html_url":"https://github.com/jordanbtucker","followers_url":"https://api.github.com/users/jordanbtucker/followers","following_url":"https://api.github.com/users/jordanbtucker/following{/other_user}","gists_url":"https://api.github.com/users/jordanbtucker/gists{/gist_id}","starred_url":"https://api.github.com/users/jordanbtucker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jordanbtucker/subscriptions","organizations_url":"https://api.github.com/users/jordanbtucker/orgs","repos_url":"https://api.github.com/users/jordanbtucker/repos","events_url":"https://api.github.com/users/jordanbtucker/events{/privacy}","received_events_url":"https://api.github.com/users/jordanbtucker/received_events","type":"User","site_admin":false},"assignees":[{"login":"jordanbtucker","id":468153,"avatar_url":"https://avatars1.githubusercontent.com/u/468153?v=4","gravatar_id":"","url":"https://api.github.com/users/jordanbtucker","html_url":"https://github.com/jordanbtucker","followers_url":"https://api.github.com/users/jordanbtucker/followers","following_url":"https://api.github.com/users/jordanbtucker/following{/other_user}","gists_url":"https://api.github.com/users/jordanbtucker/gists{/gist_id}","starred_url":"https://api.github.com/users/jordanbtucker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jordanbtucker/subscriptions","organizations_url":"https://api.github.com/users/jordanbtucker/orgs","repos_url":"https://api.github.com/users/jordanbtucker/repos","events_url":"https://api.github.com/users/jordanbtucker/events{/privacy}","received_events_url":"https://api.github.com/users/jordanbtucker/received_events","type":"User","site_admin":false}],"milestone":null,"comments":2,"created_at":"2018-05-04T20:11:13Z","updated_at":"2018-05-08T20:50:07Z","closed_at":"2018-05-08T20:50:07Z","author_association":"NONE","body":"I need to make a require on a file already loaded before, however the NodeJS require saves the cached content.\r\n\r\nThis is resolved by deleting the cache. Ex:\r\n```\r\nvar cfg = require(cfgPath)\r\ndelete require.cache[require.resolve(cfgPath)]\r\n// change the file...\r\nvar cfg = require(cfgPath) // new content is loaded\r\n```\r\n\r\nHowever when using the JSON5 library this does not work. Ex:\r\n```\r\nrequire('json5/lib/register')\r\nglobal.JSON5 = require('json5')\r\nvar cfg = require(cfgPath)\r\ndelete require.cache[require.resolve(cfgPath)]\r\n// change the file...\r\nvar cfg = require(cfgPath) // old cache contents are loaded\r\n```"}}
{"actor":{"display_login":"jordanbtucker"}}