pax_global_header00006660000000000000000000000064132701101460014505gustar00rootroot0000000000000052 comment=38acd966c721d303c8c306c858f075aecc9bbcc9 node-is-builtin-module-2.0.0/000077500000000000000000000000001327011014600157715ustar00rootroot00000000000000node-is-builtin-module-2.0.0/.editorconfig000066400000000000000000000002571327011014600204520ustar00rootroot00000000000000root = true [*] indent_style = tab end_of_line = lf charset = utf-8 trim_trailing_whitespace = true insert_final_newline = true [*.yml] indent_style = space indent_size = 2 node-is-builtin-module-2.0.0/.gitattributes000066400000000000000000000000351327011014600206620ustar00rootroot00000000000000* text=auto *.js text eol=lf node-is-builtin-module-2.0.0/.gitignore000066400000000000000000000000271327011014600177600ustar00rootroot00000000000000node_modules yarn.lock node-is-builtin-module-2.0.0/.npmrc000066400000000000000000000000231327011014600171040ustar00rootroot00000000000000package-lock=false node-is-builtin-module-2.0.0/.travis.yml000066400000000000000000000000631327011014600201010ustar00rootroot00000000000000language: node_js node_js: - '8' - '6' - '4' node-is-builtin-module-2.0.0/index.js000066400000000000000000000004141327011014600174350ustar00rootroot00000000000000'use strict'; const builtinModules = require('builtin-modules'); const moduleSet = new Set(builtinModules); module.exports = moduleName => { if (typeof moduleName !== 'string') { throw new TypeError('Expected a string'); } return moduleSet.has(moduleName); }; node-is-builtin-module-2.0.0/license000066400000000000000000000021251327011014600173360ustar00rootroot00000000000000MIT License Copyright (c) Sindre Sorhus (sindresorhus.com) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. node-is-builtin-module-2.0.0/package.json000066400000000000000000000012741327011014600202630ustar00rootroot00000000000000{ "name": "is-builtin-module", "version": "2.0.0", "description": "Check if a string matches the name of a Node.js builtin module", "license": "MIT", "repository": "sindresorhus/is-builtin-module", "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", "url": "sindresorhus.com" }, "engines": { "node": ">=4" }, "scripts": { "test": "xo && ava" }, "files": [ "index.js" ], "keywords": [ "builtin", "built-in", "builtins", "node", "modules", "core", "bundled", "list", "array", "names", "is", "detect", "check", "match" ], "dependencies": { "builtin-modules": "^2.0.0" }, "devDependencies": { "ava": "*", "xo": "*" } } node-is-builtin-module-2.0.0/readme.md000066400000000000000000000011521327011014600175470ustar00rootroot00000000000000# is-builtin-module [![Build Status](https://travis-ci.org/sindresorhus/is-builtin-module.svg?branch=master)](https://travis-ci.org/sindresorhus/is-builtin-module) > Check if a string matches the name of a Node.js builtin module ## Install ``` $ npm install is-builtin-module ``` ## Usage ```js const isBuiltinModule = require('is-builtin-module'); isBuiltinModule('fs'); //=> true isBuiltinModule('unicorn'); //=> false ``` ## Related - [builtin-modules](https://github.com/sindresorhus/builtin-modules) - List of the Node.js builtin modules ## License MIT © [Sindre Sorhus](https://sindresorhus.com) node-is-builtin-module-2.0.0/test.js000066400000000000000000000001751327011014600173110ustar00rootroot00000000000000import test from 'ava'; import m from '.'; test(t => { t.true(m('fs')); t.true(m('console')); t.false(m('unicorn')); });