{"action":"created","issue":{"url":"https://api.github.com/repos/nodejs/node/issues/3307","repository_url":"https://api.github.com/repos/nodejs/node","labels_url":"https://api.github.com/repos/nodejs/node/issues/3307/labels{/name}","comments_url":"https://api.github.com/repos/nodejs/node/issues/3307/comments","events_url":"https://api.github.com/repos/nodejs/node/issues/3307/events","html_url":"https://github.com/nodejs/node/issues/3307","id":110752525,"number":3307,"title":"Expose up-to-date list of builtin modules","user":{"login":"zkat","id":17535,"avatar_url":"https://avatars.githubusercontent.com/u/17535?v=3","gravatar_id":"","url":"https://api.github.com/users/zkat","html_url":"https://github.com/zkat","followers_url":"https://api.github.com/users/zkat/followers","following_url":"https://api.github.com/users/zkat/following{/other_user}","gists_url":"https://api.github.com/users/zkat/gists{/gist_id}","starred_url":"https://api.github.com/users/zkat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zkat/subscriptions","organizations_url":"https://api.github.com/users/zkat/orgs","repos_url":"https://api.github.com/users/zkat/repos","events_url":"https://api.github.com/users/zkat/events{/privacy}","received_events_url":"https://api.github.com/users/zkat/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/nodejs/node/labels/feature%20request","name":"feature request","color":"0D7BDE"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":18,"created_at":"2015-10-09T23:34:40Z","updated_at":"2016-02-18T14:04:39Z","closed_at":null,"body":"npm's [`normalize-package-data`](http://npm.im/normalize-package-data) needs a list of built in node modules in order to warn against potential package name conflicts (see [`fixNameField`](https://github.com/npm/normalize-package-data/blob/f7ea85c65632cfc9f37ba6821813ad6aa88e5a80/lib/fixer.js#L197-L213).\r\n\r\nWe used to have the list hardcoded, and then @sindresorhus was kind enough to author an external package that would maintain such a list, [`is-builtin-module`](http://npm.im/is-builtin-module).\r\n\r\nIt seems that this list is best maintained by node itself, since there's always a risk of things going out of sync or being just plain _wrong_. Would it be possible to expose this directly through some built-in value in node?\r\n\r\nRef: https://github.com/nodejs/node/pull/3299/files#r41686776\r\n\r\ncc @Fishrock123 \r\n"},"comment":{"url":"https://api.github.com/repos/nodejs/node/issues/comments/185735838","html_url":"https://github.com/nodejs/node/issues/3307#issuecomment-185735838","issue_url":"https://api.github.com/repos/nodejs/node/issues/3307","id":185735838,"user":{"login":"piranna","id":532414,"avatar_url":"https://avatars.githubusercontent.com/u/532414?v=3","gravatar_id":"","url":"https://api.github.com/users/piranna","html_url":"https://github.com/piranna","followers_url":"https://api.github.com/users/piranna/followers","following_url":"https://api.github.com/users/piranna/following{/other_user}","gists_url":"https://api.github.com/users/piranna/gists{/gist_id}","starred_url":"https://api.github.com/users/piranna/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/piranna/subscriptions","organizations_url":"https://api.github.com/users/piranna/orgs","repos_url":"https://api.github.com/users/piranna/repos","events_url":"https://api.github.com/users/piranna/events{/privacy}","received_events_url":"https://api.github.com/users/piranna/received_events","type":"User","site_admin":false},"created_at":"2016-02-18T14:04:39Z","updated_at":"2016-02-18T14:04:39Z","body":"That's genious :-) Good trick! :-D\nEl 18/2/2016 15:01, \"Vladimir Kurchatkin\" <notifications@github.com>\nescribió:\n\n> Here is a simple way to check if module is built-in using only public APIs:\n>\n> function isBuiltin(module) {\n>   try {\n>      const resolved = require.resolve(module);\n>      return !resolved.includes(require('path').sep);\n>    } catch(e) {\n>      return false;\n>    }\n> }\n>\n> —\n> Reply to this email directly or view it on GitHub\n> <https://github.com/nodejs/node/issues/3307#issuecomment-185734608>.\n>\n"}}