npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

n-update-cli

v0.1.0

Published

The missing update command for n

Downloads

5

Readme

n-update

The missing update command for n

Installation

Since you probably already have node, the easiest way to install n-update is through npm or yarn:

$ npm -g install n-update
$ yarn global add n-update

Usage

You can run n-update from the command line.

Updating

To update to the latest version of Node, you can simply run the binary without any arguments. If you immediatly want to prune older versions, you can pass the --prune (or -p) option.

# Install the latest Node version, equivalent of `n latest`
$ n-update
# Installed versions:
v10.16.0
+ v12.4.0
# Install the latest Node version and prune older installations, equivalent of `n latest && n prune`
$ n-update --prune
# Installed versions:
- v10.16.0
+ v12.4.0

You can also update Node versions by keyword, like lts and latest, or update the currently active Node version with current or active.

n-update lts
# Installed versions:
- v10.10.0
+ v10.16.0
n-update current
# Installed versions:
- v9.5.0
+ v9.11.2

You can even update all installed Node versions, either by major or minor release, by using the --major (or -M) and --minor or -m options.

# Update all major Node versions
$ n-update -M
# Installed versions:
- v10.10.0
+ v10.16.0
- v12.3.0
+ v12.4.0
# Update all minor Node versions
$ n-update -m
# Installed versions:
- v10.15.0
+ v10.15.3
v12.4.0

Updating Specific Versions

You can update a specific version of node only, by passing the version you want to update.

# Update to the latest 10.x.x release
$ n-update 10
# Installed versions:
v9.5.0
- v10.15.0
+ v10.16.0
# Update to the latest 10.15.x release
$ n-update 10.15
# Installed versions:
v9.5.0
v10.0.0
- v10.15.0
+ v10.15.3

You can even update multiple versions at once.

$ n-update 10 12
# Installed versions:
v9.5.0
- v10.10.0
+ v10.16.0
- v12.3.0
+ v12.4.0
$ n-update 10.15 12
# Installed versions:
v9.5.0
v10.10.0
- v10.15.0
+ v10.15.3
- v12.3.0
+ v12.4.0

Pruning

You can immediately prune any older node versions by passing the --prune (or -p) option.

# Install the latest 10.x.x release, prune any older verions
$ n-update 10 --prune
# Installed versions:
- v9.5.0
- v10.15.0
+ v10.16.0
v12.4.0
# Install the latest 10.x.x release, prune any older verions
$ n-update 10.15 --prune
# Installed versions:
- v9.5.0
- v10.0.0
- v10.15.0
+ v10.15.3

Sometimes, you may want to prune outdated releases, but keep the latest majors installed. You can pass the --major (or -M) option to achieve this.

# Install the latest 10.x.x release, prune any older verions apart from the latest majors for each release.
$ n-update 10 --major --prune
# Installed versions:
v9.5.0
- v10.15.0
+ v10.16.0
v12.4.0

If you want to keep all minor releases as well, and just prune patches, that's an option too, just pass the --minor (or -m) option to do so.

# Install the latest 10.x.x release, prune any older verions apart from the latest majors for each release.
$ n-update 10 --minor --prune
# Installed versions:
- v9.2.0
v9.2.1
v9.5.0
- v10.15.0
v10.15.3
+ v10.16.0
v12.4.0

Lastly, if you wish to keep a specific patch, you can just pass the full version for that patch, and it won't be pruned.

$ n-update 10.15 10.15.2 --prune
# Installed versions:
- v10.10.0
- v10.15.0
v10.15.2
+ v10.15.3