diff --git a/Cargo.toml b/Cargo.toml index 974445b..841b921 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "nenv" -version = "0.2.0" +version = "0.3.0" edition = "2021" diff --git a/README.md b/README.md index d1578e0..030f8e5 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ Node environment manager written in rust. - Written in fast and safe rust - Multiple active nodejs versions at the same time -- Configuration for project specific versions with the `engines.node` field in the package.json +- Configuration for project specific versions - Version matching with semver expressions ## Installation @@ -55,6 +55,28 @@ nenv list-versions ``` +## Version detection + +The node version nenv uses is controlled by + +1. The `engines.node` config field in the `package.json` which is parsed as a semver requirement. +```json +{ + "name": "my project", + "engines": { + "node": "18" + } +} +``` + +2. The `.node-version` file in the current or parent directories which contains the version string. +``` +19.4.0 +``` + +3. The `NODE_VERSION` environment variable. +4. The default version set with `nenv default`. + ## License GPL-3.0 \ No newline at end of file