package
List the Node.js versions supported by the package/repository
npm install detect-node-supportGitHub-flavored package documentation.
Across all versions.
Download trend unavailable.
Runtime metadata.
Latest published Jan 31, 2022
latest
alpha
List the Node.js versions supported by the package/repository
This repository is managed by the Package Maintenance Working Group, see Governance.
No setup is required, however if you do not have a GH_TOKEN environment limit, you will likely hit a request rate limit on Github API, which may result in very long wait times for retries.
$ npx detect-node-support [options] <path>Prints the supported Node.js versions for the package at the specified path. When the path is not a git repository - tries to read the git repository from package.json and tries to detect the versions listed in the repository as well.
When path is omitted, tries to detect the versions for cwd.
$ npx detect-node-support [options] <package name>Prints supported Node.js versions for the package from the registry.
$ npx detect-node-support [options] <repository git URL>Prints supported Node.js versions for the package at the git URL.
--deep - when used with --deps, include indirect dependencies--deps - include the support information of direct production dependencies--dev - when used with --deps, include dev dependenciesconst result = await require('detect-node-support').detect({ path }, options);path should be a folder in the local file system. When the path is not a git repository - tries to read the git repository from package.json and tries to detect the versions listed in the repository as well.
const result = await require('detect-node-support').detect({ packageName }, options);packageName is a string name for the package in the registry.
const result = await require('detect-node-support').detect({ repository }, options);repository is a URL for a git repository.
const result = await require('detect-node-support').detect(what, options);what is a string containing either a package name, or a local path, or a reference to a git repository.
deep: false - when true and used deps: true, include indirect dependenciesdeps: false - when true, include the support information of all dependencies.dev: false - when true and used with deps: true, include dev dependenciespath / repository does not have a package.jsonpackageName does not exist in the registryOtherwise returns an object with:
const result = {
// the `name` field of the `package.json`
"name": "package-name",
// the `version` field of the `package.json` when used with `path` / `repository`,
// the `latest` dist-tag version when used with `package`
"version": "0.0.0",
// the current time when the result is returned
"timestamp": 1577115956099,
// git commit hash of the repository HEAD at the time of scanning
"commit": "2de28c8c4ab8ac998d403509123736929131908c",
// will be left out when not present in the `package.json`
// a copy of the `engines.node` field from the `package.json` if present
"engines": ">=x.y.z",
// will be left out when `.travis.yml` file is not present
"travis": {
// the list of versions as detected by inspecting `node_js` / `matrix` configuration
dominykas
hello@dominykas.com
Estimated unpacked size across 63 packages.
13.6 MB+
Includes dependencies.
22.0.1
^11.1.2
16.1.0
^4.0.0
10.0.4
11.0.5