https://github.com/marcbachmann/expected-node-version
Retrieves the node version from the package.json or .nvmrc file
https://github.com/marcbachmann/expected-node-version
Last synced: 3 months ago
JSON representation
Retrieves the node version from the package.json or .nvmrc file
- Host: GitHub
- URL: https://github.com/marcbachmann/expected-node-version
- Owner: marcbachmann
- Created: 2015-09-12T13:26:32.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2023-12-15T02:26:12.000Z (over 2 years ago)
- Last Synced: 2025-10-29T20:18:20.829Z (8 months ago)
- Language: JavaScript
- Size: 3.91 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# expected-node-version
## API
var version = require('expected-node-version')([directory])
## Load order
The module tries to load the version using the fastest mechanisms.
It falls pack to loading the package.json content using `require`. So that content should will be cached.
1. fetch version from package.json environment variable, which gets set by `npm start`
2. fetch version from .nvmrc file
3. fetch version from package.json value `engines.node`