Skip to content

nvmrc-gen is a CLI utility for generating .nvmrc files.

License

Notifications You must be signed in to change notification settings

MBDesu/nvmrc-gen

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

nvmrc-gen

nvmrc-gen is a CLI utility that generates a .nvmrc file in a Node project for use with nvm. It searches the project's dependencies and finds the minimum (or maximum) Node version compatible with the project.

nvmrc-gen's primary purpose is for use in CI/CD pipelines, but it can also be useful for developers generating .nvmrc files for their own use.

Usage

Add nvmrc-gen to your PATH or copy it directly where it is intended to be ran, then run it there. It uses the working directory of the shell it is ran from.

image

Flags

Flag Description
-c CI mode. Don't prompt for writing of files.
-l Include non-LTS (oddly versioned) Node releases.
-m Get max Node version rather than min Node version.
-s Silent mode. Output no logs.

Building

Clone this repository and run go build -ldflags="-w -s" -gcflags=all=-l -o /path/to/output/nvmrc-gen to build for your architecture.

To build for other architectures, run env GOOS=<OS> GOARCH=<arch> go build -ldflags="-w -s" -gcflags=all=-l -o /path/to/output/nvmrc-gen.

The following builds are available in each release:

Target amd64 arm arm64
macOS (darwin)
FreeBSD
Linux
NetBSD
OpenBSD
Windows

The .zip file for each OS and arch is formatted as nvmrc-gen-<OS>-<arch>-<version>.zip. For example, the amd64 for macOS build of nvmrc-gen v0.1.0 is named nvmrc-gen-darwin-amd64-0.1.0.zip.

Contributing

Feel free to contribute in any way you like. This was my first project in Go, and it shows.

TODO

  • Better error handling

About

nvmrc-gen is a CLI utility for generating .nvmrc files.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages