pax_global_header 0000666 0000000 0000000 00000000064 14106774533 0014524 g ustar 00root root 0000000 0000000 52 comment=7fc1e8584058d277e47c9a74926131f79084ea93
is-core-module-2.6.0/ 0000775 0000000 0000000 00000000000 14106774533 0014355 5 ustar 00root root 0000000 0000000 is-core-module-2.6.0/.eslintignore 0000664 0000000 0000000 00000000012 14106774533 0017051 0 ustar 00root root 0000000 0000000 coverage/
is-core-module-2.6.0/.eslintrc 0000664 0000000 0000000 00000000546 14106774533 0016206 0 ustar 00root root 0000000 0000000 {
"extends": "@ljharb",
"root": true,
"rules": {
"func-style": 1,
"operator-linebreak": [2, "before"],
},
"overrides": [
{
"files": "test/**",
"rules": {
"global-require": 0,
"max-lines-per-function": 0,
"no-negated-condition": 0,
},
},
],
}
is-core-module-2.6.0/.github/ 0000775 0000000 0000000 00000000000 14106774533 0015715 5 ustar 00root root 0000000 0000000 is-core-module-2.6.0/.github/FUNDING.yml 0000664 0000000 0000000 00000001111 14106774533 0017524 0 ustar 00root root 0000000 0000000 # These are supported funding model platforms
github: [ljharb]
patreon: # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
tidelift: npm/is-core-module
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
is-core-module-2.6.0/.github/workflows/ 0000775 0000000 0000000 00000000000 14106774533 0017752 5 ustar 00root root 0000000 0000000 is-core-module-2.6.0/.github/workflows/node-4+.yml 0000664 0000000 0000000 00000003011 14106774533 0021631 0 ustar 00root root 0000000 0000000 name: 'Tests: node.js'
on: [pull_request, push]
jobs:
matrix:
runs-on: ubuntu-latest
outputs:
latest: ${{ steps.set-matrix.outputs.requireds }}
minors: ${{ steps.set-matrix.outputs.optionals }}
steps:
- uses: ljharb/actions/node/matrix@main
id: set-matrix
with:
preset: '>=4'
latest:
needs: [matrix]
name: 'latest minors'
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.matrix.outputs.latest) }}
steps:
- uses: actions/checkout@v2
- uses: ljharb/actions/node/install@main
name: 'nvm install ${{ matrix.node-version }} && npm install'
with:
node-version: ${{ matrix.node-version }}
- run: npm run tests-only
- uses: codecov/codecov-action@v1
minors:
needs: [matrix, latest]
name: 'non-latest minors'
continue-on-error: true
if: ${{ !github.head_ref || !startsWith(github.head_ref, 'renovate') }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.matrix.outputs.minors) }}
steps:
- uses: actions/checkout@v2
- uses: ljharb/actions/node/install@main
name: 'nvm install ${{ matrix.node-version }} && npm install'
with:
node-version: ${{ matrix.node-version }}
- run: npm run tests-only
- uses: codecov/codecov-action@v1
node:
name: 'node 4+'
needs: [latest, minors]
runs-on: ubuntu-latest
steps:
- run: 'echo tests completed'
is-core-module-2.6.0/.github/workflows/node-iojs.yml 0000664 0000000 0000000 00000003114 14106774533 0022363 0 ustar 00root root 0000000 0000000 name: 'Tests: node.js (io.js)'
on: [pull_request, push]
jobs:
matrix:
runs-on: ubuntu-latest
outputs:
latest: ${{ steps.set-matrix.outputs.requireds }}
minors: ${{ steps.set-matrix.outputs.optionals }}
steps:
- uses: ljharb/actions/node/matrix@main
id: set-matrix
with:
preset: 'iojs'
latest:
needs: [matrix]
name: 'latest minors'
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.matrix.outputs.latest) }}
steps:
- uses: actions/checkout@v2
- uses: ljharb/actions/node/install@main
name: 'nvm install ${{ matrix.node-version }} && npm install'
with:
node-version: ${{ matrix.node-version }}
skip-ls-check: true
- run: npm run tests-only
- uses: codecov/codecov-action@v1
minors:
needs: [matrix, latest]
name: 'non-latest minors'
continue-on-error: true
if: ${{ !github.head_ref || !startsWith(github.head_ref, 'renovate') }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.matrix.outputs.minors) }}
steps:
- uses: actions/checkout@v2
- uses: ljharb/actions/node/install@main
name: 'nvm install ${{ matrix.node-version }} && npm install'
with:
node-version: ${{ matrix.node-version }}
skip-ls-check: true
- run: npm run tests-only
- uses: codecov/codecov-action@v1
node:
name: 'io.js'
needs: [latest, minors]
runs-on: ubuntu-latest
steps:
- run: 'echo tests completed'
is-core-module-2.6.0/.github/workflows/node-pretest.yml 0000664 0000000 0000000 00000001102 14106774533 0023100 0 ustar 00root root 0000000 0000000 name: 'Tests: pretest/posttest'
on: [pull_request, push]
jobs:
pretest:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: ljharb/actions/node/install@main
name: 'nvm install lts/* && npm install'
with:
node-version: 'lts/*'
- run: npm run pretest
posttest:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: ljharb/actions/node/install@main
name: 'nvm install lts/* && npm install'
with:
node-version: 'lts/*'
- run: npm run posttest
is-core-module-2.6.0/.github/workflows/node-zero.yml 0000664 0000000 0000000 00000003462 14106774533 0022404 0 ustar 00root root 0000000 0000000 name: 'Tests: node.js (0.x)'
on: [pull_request, push]
jobs:
matrix:
runs-on: ubuntu-latest
outputs:
stable: ${{ steps.set-matrix.outputs.requireds }}
unstable: ${{ steps.set-matrix.outputs.optionals }}
steps:
- uses: ljharb/actions/node/matrix@main
id: set-matrix
with:
preset: '0.x'
stable:
needs: [matrix]
name: 'stable minors'
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.matrix.outputs.stable) }}
steps:
- uses: actions/checkout@v2
- uses: ljharb/actions/node/install@main
name: 'nvm install ${{ matrix.node-version }} && npm install'
with:
node-version: ${{ matrix.node-version }}
cache-node-modules-key: node_modules-${{ github.workflow }}-${{ github.action }}-${{ github.run_id }}
skip-ls-check: true
- run: npm run tests-only
- uses: codecov/codecov-action@v1
unstable:
needs: [matrix, stable]
name: 'unstable minors'
continue-on-error: true
if: ${{ !github.head_ref || !startsWith(github.head_ref, 'renovate') }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.matrix.outputs.unstable) }}
steps:
- uses: actions/checkout@v2
- uses: ljharb/actions/node/install@main
name: 'nvm install ${{ matrix.node-version }} && npm install'
with:
node-version: ${{ matrix.node-version }}
cache-node-modules-key: node_modules-${{ github.workflow }}-${{ github.action }}-${{ github.run_id }}
skip-ls-check: true
- run: npm run tests-only
- uses: codecov/codecov-action@v1
node:
name: 'node 0.x'
needs: [stable, unstable]
runs-on: ubuntu-latest
steps:
- run: 'echo tests completed'
is-core-module-2.6.0/.github/workflows/rebase.yml 0000664 0000000 0000000 00000000401 14106774533 0021731 0 ustar 00root root 0000000 0000000 name: Automatic Rebase
on: [pull_request_target]
jobs:
_:
name: "Automatic Rebase"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: ljharb/rebase@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
is-core-module-2.6.0/.github/workflows/require-allow-edits.yml 0000664 0000000 0000000 00000000301 14106774533 0024365 0 ustar 00root root 0000000 0000000 name: Require “Allow Edits”
on: [pull_request_target]
jobs:
_:
name: "Require “Allow Edits”"
runs-on: ubuntu-latest
steps:
- uses: ljharb/require-allow-edits@main
is-core-module-2.6.0/.gitignore 0000664 0000000 0000000 00000003235 14106774533 0016350 0 ustar 00root root 0000000 0000000 # Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
# Runtime data
pids
*.pid
*.seed
*.pid.lock
# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
# Coverage directory used by tools like istanbul
coverage
*.lcov
# nyc test coverage
.nyc_output
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt
# Bower dependency directory (https://bower.io/)
bower_components
# node-waf configuration
.lock-wscript
# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release
# Dependency directories
node_modules/
jspm_packages/
# TypeScript v1 declaration files
typings/
# TypeScript cache
*.tsbuildinfo
# Optional npm cache directory
.npm
# Optional eslint cache
.eslintcache
# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/
# Optional REPL history
.node_repl_history
# Output of 'npm pack'
*.tgz
# Yarn Integrity file
.yarn-integrity
# dotenv environment variables file
.env
.env.test
# parcel-bundler cache (https://parceljs.org/)
.cache
# Next.js build output
.next
# Nuxt.js build / generate output
.nuxt
dist
# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and *not* Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public
# vuepress build output
.vuepress/dist
# Serverless directories
.serverless/
# FuseBox cache
.fusebox/
# DynamoDB Local files
.dynamodb/
# TernJS port file
.tern-port
# Only apps should have lockfiles
npm-shrinkwrap.json
package-lock.json
yarn.lock
is-core-module-2.6.0/.npmignore 0000664 0000000 0000000 00000003230 14106774533 0016352 0 ustar 00root root 0000000 0000000 # Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
# Runtime data
pids
*.pid
*.seed
*.pid.lock
# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
# Coverage directory used by tools like istanbul
coverage
*.lcov
# nyc test coverage
.nyc_output
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt
# Bower dependency directory (https://bower.io/)
bower_components
# node-waf configuration
.lock-wscript
# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release
# Dependency directories
jspm_packages/
# TypeScript v1 declaration files
typings/
# TypeScript cache
*.tsbuildinfo
# Optional npm cache directory
.npm
# Optional eslint cache
.eslintcache
# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/
# Optional REPL history
.node_repl_history
# Output of 'npm pack'
*.tgz
# Yarn Integrity file
.yarn-integrity
# dotenv environment variables file
.env
.env.test
# parcel-bundler cache (https://parceljs.org/)
.cache
# Next.js build output
.next
# Nuxt.js build / generate output
.nuxt
dist
# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and *not* Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public
# vuepress build output
.vuepress/dist
# Serverless directories
.serverless/
# FuseBox cache
.fusebox/
# DynamoDB Local files
.dynamodb/
# TernJS port file
.tern-port
# Only apps should have lockfiles
npm-shrinkwrap.json
package-lock.json
yarn.lock
.github
is-core-module-2.6.0/.npmrc 0000664 0000000 0000000 00000000067 14106774533 0015500 0 ustar 00root root 0000000 0000000 package-lock=false
allow-same-version=true
message=v%s
is-core-module-2.6.0/.nycrc 0000664 0000000 0000000 00000000213 14106774533 0015470 0 ustar 00root root 0000000 0000000 {
"all": true,
"check-coverage": false,
"reporter": ["text-summary", "text", "html", "json"],
"exclude": [
"coverage",
"test"
]
}
is-core-module-2.6.0/CHANGELOG.md 0000664 0000000 0000000 00000016627 14106774533 0016202 0 ustar 00root root 0000000 0000000 # Changelog
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [v2.6.0](https://github.com/inspect-js/is-core-module/compare/v2.5.0...v2.6.0) - 2021-08-17
### Commits
- [Dev Deps] update `eslint`, `tape` [`6cc928f`](https://github.com/inspect-js/is-core-module/commit/6cc928f8a4bba66aeeccc4f6beeac736d4bd3081)
- [New] add `stream/consumers` to node `>= 16.7` [`a1a423e`](https://github.com/inspect-js/is-core-module/commit/a1a423e467e4cc27df180234fad5bab45943e67d)
- [Refactor] Remove duplicated `&&` operand [`86faea7`](https://github.com/inspect-js/is-core-module/commit/86faea738213a2433c62d1098488dc9314dca832)
- [Tests] include prereleases [`a4da7a6`](https://github.com/inspect-js/is-core-module/commit/a4da7a6abf7568e2aa4fd98e69452179f1850963)
## [v2.5.0](https://github.com/inspect-js/is-core-module/compare/v2.4.0...v2.5.0) - 2021-07-12
### Commits
- [Dev Deps] update `auto-changelog`, `eslint` [`6334cc9`](https://github.com/inspect-js/is-core-module/commit/6334cc94f3af7469685bd8f236740991baaf2705)
- [New] add `stream/web` to node v16.5+ [`17ac59b`](https://github.com/inspect-js/is-core-module/commit/17ac59b662d63e220a2e5728625f005c24f177b2)
## [v2.4.0](https://github.com/inspect-js/is-core-module/compare/v2.3.0...v2.4.0) - 2021-05-09
### Commits
- [readme] add actions and codecov badges [`82b7faa`](https://github.com/inspect-js/is-core-module/commit/82b7faa12b56dbe47fbea67e1a5b9e447027ba40)
- [Dev Deps] update `@ljharb/eslint-config`, `aud` [`8096868`](https://github.com/inspect-js/is-core-module/commit/8096868c024a161ccd4d44110b136763e92eace8)
- [Dev Deps] update `eslint` [`6726824`](https://github.com/inspect-js/is-core-module/commit/67268249b88230018c510f6532a8046d7326346f)
- [New] add `diagnostics_channel` to node `^14.17` [`86c6563`](https://github.com/inspect-js/is-core-module/commit/86c65634201b8ff9b3e48a9a782594579c7f5c3c)
- [meta] fix prepublish script [`697a01e`](https://github.com/inspect-js/is-core-module/commit/697a01e3c9c0be074066520954f30fb28532ec57)
## [v2.3.0](https://github.com/inspect-js/is-core-module/compare/v2.2.0...v2.3.0) - 2021-04-24
### Commits
- [meta] do not publish github action workflow files [`060d4bb`](https://github.com/inspect-js/is-core-module/commit/060d4bb971a29451c19ff336eb56bee27f9fa95a)
- [New] add support for `node:` prefix, in node 16+ [`7341223`](https://github.com/inspect-js/is-core-module/commit/73412230a769f6e81c05eea50b6520cebf54ed2f)
- [actions] use `node/install` instead of `node/run`; use `codecov` action [`016269a`](https://github.com/inspect-js/is-core-module/commit/016269abae9f6657a5254adfbb813f09a05067f9)
- [patch] remove unneeded `.0` in version ranges [`cb466a6`](https://github.com/inspect-js/is-core-module/commit/cb466a6d89e52b8389e5c12715efcd550c41cea3)
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `tape` [`c9f9c39`](https://github.com/inspect-js/is-core-module/commit/c9f9c396ace60ef81906f98059c064e6452473ed)
- [actions] update workflows [`3ee4a89`](https://github.com/inspect-js/is-core-module/commit/3ee4a89fd5a02fccd43882d905448ea6a98e9a3c)
- [Dev Deps] update `eslint`, `@ljharb/eslint-config` [`dee4fed`](https://github.com/inspect-js/is-core-module/commit/dee4fed79690c1d43a22f7fa9426abebdc6d727f)
- [Dev Deps] update `eslint`, `@ljharb/eslint-config` [`7d046ba`](https://github.com/inspect-js/is-core-module/commit/7d046ba07ae8c9292e43652694ca808d7b309de8)
- [meta] use `prepublishOnly` script for npm 7+ [`149e677`](https://github.com/inspect-js/is-core-module/commit/149e6771a5ede6d097e71785b467a9c4b4977cc7)
- [readme] remove travis badge [`903b51d`](https://github.com/inspect-js/is-core-module/commit/903b51d6b69b98abeabfbc3695c345b02646f19c)
## [v2.2.0](https://github.com/inspect-js/is-core-module/compare/v2.1.0...v2.2.0) - 2020-11-26
### Commits
- [Tests] migrate tests to Github Actions [`c919f57`](https://github.com/inspect-js/is-core-module/commit/c919f573c0a92d10a0acad0b650b5aecb033d426)
- [patch] `core.json`: %s/ /\t/g [`db3f685`](https://github.com/inspect-js/is-core-module/commit/db3f68581f53e73cc09cd675955eb1bdd6a5a39b)
- [Tests] run `nyc` on all tests [`b2f925f`](https://github.com/inspect-js/is-core-module/commit/b2f925f8866f210ef441f39fcc8cc42692ab89b1)
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`; add `safe-publish-latest` [`89f02a2`](https://github.com/inspect-js/is-core-module/commit/89f02a2b4162246dea303a6ee31bb9a550b05c72)
- [New] add `path/posix`, `path/win32`, `util/types` [`77f94f1`](https://github.com/inspect-js/is-core-module/commit/77f94f1e90ffd7c0be2a3f1aa8574ebf7fd981b3)
## [v2.1.0](https://github.com/inspect-js/is-core-module/compare/v2.0.0...v2.1.0) - 2020-11-04
### Commits
- [Dev Deps] update `eslint` [`5e0034e`](https://github.com/inspect-js/is-core-module/commit/5e0034eae57c09c8f1bd769f502486a00f56c6e4)
- [New] Add `diagnostics_channel` [`c2d83d0`](https://github.com/inspect-js/is-core-module/commit/c2d83d0a0225a1a658945d9bab7036ea347d29ec)
## [v2.0.0](https://github.com/inspect-js/is-core-module/compare/v1.0.2...v2.0.0) - 2020-09-29
### Commits
- v2 implementation [`865aeb5`](https://github.com/inspect-js/is-core-module/commit/865aeb5ca0e90248a3dfff5d7622e4751fdeb9cd)
- Only apps should have lockfiles [`5a5e660`](https://github.com/inspect-js/is-core-module/commit/5a5e660d568e37eb44e17fb1ebb12a105205fc2b)
- Initial commit for v2 [`5a51524`](https://github.com/inspect-js/is-core-module/commit/5a51524e06f92adece5fbb138c69b7b9748a2348)
- Tests [`116eae4`](https://github.com/inspect-js/is-core-module/commit/116eae4fccd01bc72c1fd3cc4b7561c387afc496)
- [meta] add `auto-changelog` [`c24388b`](https://github.com/inspect-js/is-core-module/commit/c24388bee828d223040519d1f5b226ca35beee63)
- [actions] add "Automatic Rebase" and "require allow edits" actions [`34292db`](https://github.com/inspect-js/is-core-module/commit/34292dbcbadae0868aff03c22dbd8b7b8a11558a)
- [Tests] add `npm run lint` [`4f9eeee`](https://github.com/inspect-js/is-core-module/commit/4f9eeee7ddff10698bbf528620f4dc8d4fa3e697)
- [readme] fix travis badges, https all URLs [`e516a73`](https://github.com/inspect-js/is-core-module/commit/e516a73b0dccce20938c432b1ba512eae8eff9e9)
- [meta] create FUNDING.yml [`1aabebc`](https://github.com/inspect-js/is-core-module/commit/1aabebca98d01f8a04e46bc2e2520fa93cf21ac6)
- [Fix] `domain`: domain landed sometime > v0.7.7 and <= v0.7.12 [`2df7d37`](https://github.com/inspect-js/is-core-module/commit/2df7d37595d41b15eeada732b706b926c2771655)
- [Fix] `sys`: worked in 0.6, not 0.7, and 0.8+ [`a75c134`](https://github.com/inspect-js/is-core-module/commit/a75c134229e1e9441801f6b73f6a52489346eb65)
## [v1.0.2](https://github.com/inspect-js/is-core-module/compare/v1.0.1...v1.0.2) - 2014-09-28
### Commits
- simpler [`66fe90f`](https://github.com/inspect-js/is-core-module/commit/66fe90f9771581b9adc0c3900baa52c21b5baea2)
## [v1.0.1](https://github.com/inspect-js/is-core-module/compare/v1.0.0...v1.0.1) - 2014-09-28
### Commits
- remove stupid [`f21f906`](https://github.com/inspect-js/is-core-module/commit/f21f906f882c2bd656a5fc5ed6fbe48ddaffb2ac)
- update readme [`1eff0ec`](https://github.com/inspect-js/is-core-module/commit/1eff0ec69798d1ec65771552d1562911e90a8027)
## v1.0.0 - 2014-09-28
### Commits
- init [`48e5e76`](https://github.com/inspect-js/is-core-module/commit/48e5e76cac378fddb8c1f7d4055b8dfc943d6b96)
is-core-module-2.6.0/LICENSE 0000664 0000000 0000000 00000002066 14106774533 0015366 0 ustar 00root root 0000000 0000000 The MIT License (MIT)
Copyright (c) 2014 Dave Justice
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. is-core-module-2.6.0/README.md 0000664 0000000 0000000 00000003173 14106774533 0015640 0 ustar 00root root 0000000 0000000 # is-core-module [![Version Badge][2]][1]
[![github actions][actions-image]][actions-url]
[![coverage][codecov-image]][codecov-url]
[![dependency status][5]][6]
[![dev dependency status][7]][8]
[![License][license-image]][license-url]
[![Downloads][downloads-image]][downloads-url]
[![npm badge][11]][1]
Is this specifier a node.js core module? Optionally provide a node version to check; defaults to the current node version.
## Example
```js
var isCore = require('is-core-module');
var assert = require('assert');
assert(isCore('fs'));
assert(!isCore('butts'));
```
## Tests
Clone the repo, `npm install`, and run `npm test`
[1]: https://npmjs.org/package/is-core-module
[2]: https://versionbadg.es/inspect-js/is-core-module.svg
[5]: https://david-dm.org/inspect-js/is-core-module.svg
[6]: https://david-dm.org/inspect-js/is-core-module
[7]: https://david-dm.org/inspect-js/is-core-module/dev-status.svg
[8]: https://david-dm.org/inspect-js/is-core-module#info=devDependencies
[11]: https://nodei.co/npm/is-core-module.png?downloads=true&stars=true
[license-image]: https://img.shields.io/npm/l/is-core-module.svg
[license-url]: LICENSE
[downloads-image]: https://img.shields.io/npm/dm/is-core-module.svg
[downloads-url]: https://npm-stat.com/charts.html?package=is-core-module
[codecov-image]: https://codecov.io/gh/inspect-js/is-core-module/branch/main/graphs/badge.svg
[codecov-url]: https://app.codecov.io/gh/inspect-js/is-core-module/
[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/inspect-js/is-core-module
[actions-url]: https://github.com/inspect-js/is-core-module/actions
is-core-module-2.6.0/core.json 0000664 0000000 0000000 00000010064 14106774533 0016201 0 ustar 00root root 0000000 0000000 {
"assert": true,
"node:assert": ">= 16",
"assert/strict": ">= 15",
"node:assert/strict": ">= 16",
"async_hooks": ">= 8",
"node:async_hooks": ">= 16",
"buffer_ieee754": "< 0.9.7",
"buffer": true,
"node:buffer": ">= 16",
"child_process": true,
"node:child_process": ">= 16",
"cluster": true,
"node:cluster": ">= 16",
"console": true,
"node:console": ">= 16",
"constants": true,
"node:constants": ">= 16",
"crypto": true,
"node:crypto": ">= 16",
"_debug_agent": ">= 1 && < 8",
"_debugger": "< 8",
"dgram": true,
"node:dgram": ">= 16",
"diagnostics_channel": [">= 14.17 && < 15", ">= 15.1"],
"node:diagnostics_channel": ">= 16",
"dns": true,
"node:dns": ">= 16",
"dns/promises": ">= 15",
"node:dns/promises": ">= 16",
"domain": ">= 0.7.12",
"node:domain": ">= 16",
"events": true,
"node:events": ">= 16",
"freelist": "< 6",
"fs": true,
"node:fs": ">= 16",
"fs/promises": [">= 10 && < 10.1", ">= 14"],
"node:fs/promises": ">= 16",
"_http_agent": ">= 0.11.1",
"node:_http_agent": ">= 16",
"_http_client": ">= 0.11.1",
"node:_http_client": ">= 16",
"_http_common": ">= 0.11.1",
"node:_http_common": ">= 16",
"_http_incoming": ">= 0.11.1",
"node:_http_incoming": ">= 16",
"_http_outgoing": ">= 0.11.1",
"node:_http_outgoing": ">= 16",
"_http_server": ">= 0.11.1",
"node:_http_server": ">= 16",
"http": true,
"node:http": ">= 16",
"http2": ">= 8.8",
"node:http2": ">= 16",
"https": true,
"node:https": ">= 16",
"inspector": ">= 8",
"node:inspector": ">= 16",
"_linklist": "< 8",
"module": true,
"node:module": ">= 16",
"net": true,
"node:net": ">= 16",
"node-inspect/lib/_inspect": ">= 7.6 && < 12",
"node-inspect/lib/internal/inspect_client": ">= 7.6 && < 12",
"node-inspect/lib/internal/inspect_repl": ">= 7.6 && < 12",
"os": true,
"node:os": ">= 16",
"path": true,
"node:path": ">= 16",
"path/posix": ">= 15.3",
"node:path/posix": ">= 16",
"path/win32": ">= 15.3",
"node:path/win32": ">= 16",
"perf_hooks": ">= 8.5",
"node:perf_hooks": ">= 16",
"process": ">= 1",
"node:process": ">= 16",
"punycode": true,
"node:punycode": ">= 16",
"querystring": true,
"node:querystring": ">= 16",
"readline": true,
"node:readline": ">= 16",
"repl": true,
"node:repl": ">= 16",
"smalloc": ">= 0.11.5 && < 3",
"_stream_duplex": ">= 0.9.4",
"node:_stream_duplex": ">= 16",
"_stream_transform": ">= 0.9.4",
"node:_stream_transform": ">= 16",
"_stream_wrap": ">= 1.4.1",
"node:_stream_wrap": ">= 16",
"_stream_passthrough": ">= 0.9.4",
"node:_stream_passthrough": ">= 16",
"_stream_readable": ">= 0.9.4",
"node:_stream_readable": ">= 16",
"_stream_writable": ">= 0.9.4",
"node:_stream_writable": ">= 16",
"stream": true,
"node:stream": ">= 16",
"stream/consumers": ">= 16.7",
"node:stream/consumers": ">= 16.7",
"stream/promises": ">= 15",
"node:stream/promises": ">= 16",
"stream/web": ">= 16.5",
"node:stream/web": ">= 16.5",
"string_decoder": true,
"node:string_decoder": ">= 16",
"sys": [">= 0.6 && < 0.7", ">= 0.8"],
"node:sys": ">= 16",
"timers": true,
"node:timers": ">= 16",
"timers/promises": ">= 15",
"node:timers/promises": ">= 16",
"_tls_common": ">= 0.11.13",
"node:_tls_common": ">= 16",
"_tls_legacy": ">= 0.11.3 && < 10",
"_tls_wrap": ">= 0.11.3",
"node:_tls_wrap": ">= 16",
"tls": true,
"node:tls": ">= 16",
"trace_events": ">= 10",
"node:trace_events": ">= 16",
"tty": true,
"node:tty": ">= 16",
"url": true,
"node:url": ">= 16",
"util": true,
"node:util": ">= 16",
"util/types": ">= 15.3",
"node:util/types": ">= 16",
"v8/tools/arguments": ">= 10 && < 12",
"v8/tools/codemap": [">= 4.4 && < 5", ">= 5.2 && < 12"],
"v8/tools/consarray": [">= 4.4 && < 5", ">= 5.2 && < 12"],
"v8/tools/csvparser": [">= 4.4 && < 5", ">= 5.2 && < 12"],
"v8/tools/logreader": [">= 4.4 && < 5", ">= 5.2 && < 12"],
"v8/tools/profile_view": [">= 4.4 && < 5", ">= 5.2 && < 12"],
"v8/tools/splaytree": [">= 4.4 && < 5", ">= 5.2 && < 12"],
"v8": ">= 1",
"node:v8": ">= 16",
"vm": true,
"node:vm": ">= 16",
"wasi": ">= 13.4 && < 13.5",
"worker_threads": ">= 11.7",
"node:worker_threads": ">= 16",
"zlib": true,
"node:zlib": ">= 16"
}
is-core-module-2.6.0/index.js 0000664 0000000 0000000 00000003335 14106774533 0016026 0 ustar 00root root 0000000 0000000 'use strict';
var has = require('has');
function specifierIncluded(current, specifier) {
var nodeParts = current.split('.');
var parts = specifier.split(' ');
var op = parts.length > 1 ? parts[0] : '=';
var versionParts = (parts.length > 1 ? parts[1] : parts[0]).split('.');
for (var i = 0; i < 3; ++i) {
var cur = parseInt(nodeParts[i] || 0, 10);
var ver = parseInt(versionParts[i] || 0, 10);
if (cur === ver) {
continue; // eslint-disable-line no-restricted-syntax, no-continue
}
if (op === '<') {
return cur < ver;
}
if (op === '>=') {
return cur >= ver;
}
return false;
}
return op === '>=';
}
function matchesRange(current, range) {
var specifiers = range.split(/ ?&& ?/);
if (specifiers.length === 0) {
return false;
}
for (var i = 0; i < specifiers.length; ++i) {
if (!specifierIncluded(current, specifiers[i])) {
return false;
}
}
return true;
}
function versionIncluded(nodeVersion, specifierValue) {
if (typeof specifierValue === 'boolean') {
return specifierValue;
}
var current = typeof nodeVersion === 'undefined'
? process.versions && process.versions.node
: nodeVersion;
if (typeof current !== 'string') {
throw new TypeError(typeof nodeVersion === 'undefined' ? 'Unable to determine current node version' : 'If provided, a valid node version is required');
}
if (specifierValue && typeof specifierValue === 'object') {
for (var i = 0; i < specifierValue.length; ++i) {
if (matchesRange(current, specifierValue[i])) {
return true;
}
}
return false;
}
return matchesRange(current, specifierValue);
}
var data = require('./core.json');
module.exports = function isCore(x, nodeVersion) {
return has(data, x) && versionIncluded(nodeVersion, data[x]);
};
is-core-module-2.6.0/package.json 0000664 0000000 0000000 00000003215 14106774533 0016644 0 ustar 00root root 0000000 0000000 {
"name": "is-core-module",
"version": "2.6.0",
"description": "Is this specifier a node.js core module?",
"main": "index.js",
"exports": {
".": [
{
"default": "./index.js"
},
"./index.js"
],
"./package.json": "./package.json"
},
"scripts": {
"prepublish": "not-in-publish || npm run prepublishOnly",
"prepublishOnly": "safe-publish-latest",
"lint": "eslint .",
"pretest": "npm run lint",
"tests-only": "tape 'test/**/*.js'",
"test": "nyc npm run tests-only",
"posttest": "aud --production",
"version": "auto-changelog && git add CHANGELOG.md",
"postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\""
},
"repository": {
"type": "git",
"url": "git+https://github.com/inspect-js/is-core-module.git"
},
"keywords": [
"core",
"modules",
"module",
"npm",
"node",
"dependencies"
],
"author": "Jordan Harband ",
"funding": {
"url": "https://github.com/sponsors/ljharb"
},
"license": "MIT",
"bugs": {
"url": "https://github.com/inspect-js/is-core-module/issues"
},
"homepage": "https://github.com/inspect-js/is-core-module",
"dependencies": {
"has": "^1.0.3"
},
"devDependencies": {
"@ljharb/eslint-config": "^17.6.0",
"aud": "^1.1.5",
"auto-changelog": "^2.3.0",
"eslint": "^7.32.0",
"nyc": "^10.3.2",
"safe-publish-latest": "^1.1.4",
"semver": "^6.3.0",
"tape": "^5.3.1"
},
"auto-changelog": {
"output": "CHANGELOG.md",
"template": "keepachangelog",
"unreleased": false,
"commitLimit": false,
"backfillLimit": false,
"hideCredit": true
}
}
is-core-module-2.6.0/test/ 0000775 0000000 0000000 00000000000 14106774533 0015334 5 ustar 00root root 0000000 0000000 is-core-module-2.6.0/test/index.js 0000664 0000000 0000000 00000005630 14106774533 0017005 0 ustar 00root root 0000000 0000000 'use strict';
var test = require('tape');
var keys = require('object-keys');
var semver = require('semver');
var isCore = require('../');
var data = require('../core.json');
var supportsNodePrefix = semver.satisfies(process.versions.node, '>= 16', { includePrerelease: true });
test('core modules', function (t) {
t.test('isCore()', function (st) {
st.ok(isCore('fs'));
st.ok(isCore('net'));
st.ok(isCore('http'));
st.ok(!isCore('seq'));
st.ok(!isCore('../'));
st.ok(!isCore('toString'));
st.end();
});
t.test('core list', function (st) {
var cores = keys(data);
st.plan(cores.length);
for (var i = 0; i < cores.length; ++i) {
var mod = cores[i];
var requireFunc = function () { require(mod); }; // eslint-disable-line no-loop-func
if (isCore(mod)) {
st.doesNotThrow(requireFunc, mod + ' supported; requiring does not throw');
} else {
st['throws'](requireFunc, mod + ' not supported; requiring throws');
}
}
st.end();
});
t.test('core via repl module', { skip: !data.repl }, function (st) {
var libs = require('repl')._builtinLibs; // eslint-disable-line no-underscore-dangle
if (!libs) {
st.skip('module.builtinModules does not exist');
} else {
for (var i = 0; i < libs.length; ++i) {
var mod = libs[i];
st.ok(data[mod], mod + ' is a core module');
st.doesNotThrow(
function () { require(mod); }, // eslint-disable-line no-loop-func
'requiring ' + mod + ' does not throw'
);
if (supportsNodePrefix) {
st.doesNotThrow(
function () { require('node:' + mod); }, // eslint-disable-line no-loop-func
'requiring node:' + mod + ' does not throw'
);
} else {
st['throws'](
function () { require('node:' + mod); }, // eslint-disable-line no-loop-func
'requiring node:' + mod + ' throws'
);
}
}
}
st.end();
});
t.test('core via builtinModules list', { skip: !data.module }, function (st) {
var libs = require('module').builtinModules;
if (!libs) {
st.skip('module.builtinModules does not exist');
} else {
var excludeList = [
'_debug_agent',
'v8/tools/tickprocessor-driver',
'v8/tools/SourceMap',
'v8/tools/tickprocessor',
'v8/tools/profile'
];
for (var i = 0; i < libs.length; ++i) {
var mod = libs[i];
if (excludeList.indexOf(mod) === -1) {
st.ok(data[mod], mod + ' is a core module');
st.doesNotThrow(
function () { require(mod); }, // eslint-disable-line no-loop-func
'requiring ' + mod + ' does not throw'
);
if (supportsNodePrefix) {
st.doesNotThrow(
function () { require('node:' + mod); }, // eslint-disable-line no-loop-func
'requiring node:' + mod + ' does not throw'
);
} else {
st['throws'](
function () { require('node:' + mod); }, // eslint-disable-line no-loop-func
'requiring node:' + mod + ' throws'
);
}
}
}
}
st.end();
});
t.end();
});