An open API service indexing awesome lists of open source software.

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

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`