
Security News
Node.js TSC Votes to Stop Distributing Corepack
Corepack will be phased out from future Node.js releases following a TSC vote.
detect-node-support
Advanced tools
List the Node.js versions supported by the package/repository
$ npx detect-node-support [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 [package name]
Prints supported Node.js versions for the package from the registry.
$ npx detect-node-support [repository git URL]
Prints supported Node.js versions for the package at the git URL.
const result = await require('detect-node-support').detect({ path });
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 });
packageName
is a string name for the package in the registry.
const result = await require('detect-node-support').detect({ repository });
repository
is a URL for a git repository.
path
/ repository
does not have a package.json
packageName
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
// will be an empty array when no versions are detected or the project is not a Node.js project
// will contain "latest" when `language: node_js` specified, but no explicit versions detected
"raw": ["8", "10", "lts/*", "invalid-specifier"],
// raw version specifiers and keywords (as keys) resolved to exact Node.js versions (as values)
// the value will be `false` when the specifier/keyword is unrecognized
// will be an empty object when the `raw` array is empty
"resolved": {
"8": "8.17.0",
"10": "10.18.0",
"lts/*": "12.14.0",
"invalid-specifier": false
}
}
}
FAQs
List the Node.js versions supported by the package/repository
The npm package detect-node-support receives a total of 0 weekly downloads. As such, detect-node-support popularity was classified as not popular.
We found that detect-node-support demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Corepack will be phased out from future Node.js releases following a TSC vote.
Research
Security News
Research uncovers Black Basta's plans to exploit package registries for ransomware delivery alongside evidence of similar attacks already targeting open source ecosystems.
Security News
Oxlint's beta release introduces 500+ built-in linting rules while delivering twice the speed of previous versions, with future support planned for custom plugins and improved IDE integration.