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

@sahilks/dummy-library

v0.2.11

Published

This GitHub Action automates the process of managing the version of an npm package, including updating the package version number, stashing any changes to the code, and pushing the changes back to the repository. Additionally, it includes a step to publis

Downloads

15

Readme

Node Package version control/versioning

This GitHub Action automates the process of managing the version of an npm package, including updating the package version number, stashing any changes to the code, and pushing the changes back to the repository. Additionally, it includes a step to publish the updated package to the npm registry.

Workflow

The workflow is triggered when a push event occurs on the main branch. There are two jobs included in this workflow: build and publish. The build job updates the package version and pushes the changes back to the repository, while the publish job installs the updated packages and publishes them to the npm registry.

Steps

  • Checkout: This step checks out the repository code in order to perform the necessary updates and changes.
  • Authenticate with GitHub: This step authenticates the user's GitHub account using a GitHub token, which is stored in the GH_TOKEN secret. This allows the GitHub API to be used in subsequent steps.
  • Set git user: This step sets the git user name and email, which is required to make commits to the repository.
  • Stash changes: This step stashes any changes to the repository code, which will be applied after the package version has been updated.
  • Update package version: This step uses the npm version command to update the package version, using the patch option to increment the patch number of the current version. This command also updates the package.json file in the repository with the new version number.
  • Apply stash: This step applies the stashed changes to the repository code, including the updated package.json file. The changes are then pushed back to the repository using the git push command.
  • Checkout: This step checks out the repository code in the publish job, which is required to install the updated packages.
  • Setup node: This step sets up the node environment using the specified version and registry URL.
  • Install packages: This step installs the updated packages using the npm install command.
  • Publish: This step publishes the updated packages to the npm registry using the npm publish command. The authentication token is stored in the NODE_AUTH_TOKEN secret.

Secrets

This workflow requires two secrets to be stored in the GitHub repository:

  • GH_TOKEN: This secret contains a GitHub token, which is required to authenticate with the GitHub API in order to make changes to the repository.

    NOTE: In this github token you need to give permission for: Full control of private repositories and workflow. Eg: text

  • NPM_AUTH_TOKEN: This secret contains an npm authentication token, which is required to publish packages to the npm registry.

    NOTE: In this npm token you need to give permission for: Automation. Eg: text

Important Note:

NOTE: Make sure you can give Workflow permissions for read and write. Eg: text then text then click the save button.

Usage

To use this GitHub Action in your repository, create a new file in the .github/workflows directory with a name such as manage-npm-package-version.yml. Then copy and paste the code from this repository into the new file.

Make sure to add the necessary secrets to your repository settings in order for the workflow to function properly.

Conclusion

By using this GitHub Action, developers can save time and ensure that their npm packages are always up-to-date with the latest version number. This automation reduces the possibility of errors and ensures that the package version number is consistent across different environments.