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

@developerso/verisonchecker

v1.0.0

Published

This module will check version of the node modules and automatically update it.

Downloads

1

Readme

About

versionChecker() is a Node.js module that allows you to check and update the version of an npm package. It provides two functions: setCurrentVersion() and syncVersion().

The setCurrentVersion() function takes a string parameter representing the current version of the package you want to check. This function sets the current variable to the specified value.

The syncVersion() function takes a string parameter representing the name of the package you want to check. It uses the npm registry API to get the latest version of the package and compares it to the current version set by setCurrentVersion(). If the versions are the same, it logs a message saying that the package is up-to-date. If they are different, it prompts the user to update the package. If the user chooses to update, it installs the latest version of the package and displays the changelog.

This module uses the axios and readline Node.js packages to make HTTP requests and prompt the user for input. It also uses the execSync function from the child_process module to install the latest version of the package.

To use this module, you first need to install it using npm. You can then require it in your Node.js script and create a new instance of it using the versionChecker() function. You can then set the current version using setCurrentVersion() and check the version of a package using syncVersion().

Installation

You can install versionchecker using NPM


npm install @developerso/versionchecker

Usage

First, require the module in your Node.js script:


const versionChecker = require('@developerso/versionchecker');

Then, create a new instance of the module and set the current version of the package you want to check:


const vc = versionChecker();

vc.setCurrentVersion('1.0.0');

Finally, call the syncVersion() method with the name of the package you want to check:


vc.syncVersion('package-name');

The module will check if the latest version of the package is different from the current version you set. If it is, it will prompt you to update the package. If you choose to update, it will install the latest version and display the changelog.

Example


const versionChecker = require('version-checker');



const vc = versionChecker();

vc.setCurrentVersion('1.0.0');



vc.syncVersion('express');

License

This project is licensed under MIT