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

version-for-publishing

v0.1.7

Published

A github action to retrieve package version for CDN deploys, etc.

Downloads

7

Readme

version-for-publishing

This action generates a new dev version number for a git branch, e.g. 1-0-0 for all projects where the version is part of a json file, e.g. package.json.

It accepts a json file path and a branch name as input. No release magic or analyzing changelogs is happening. The main part of the version, e.g. 1.0.0 will not be touched.

What is happening

  1. reads a json file - in general a package.json
  2. check the version field in the json file
  3. defaults to 1-0-0
  4. provides the new version string as output of the action
  5. Now you can do what you want, e.g. commit & push the changes, use it for a build step or anything else :)

Examples

Simple branch

  1. there is a branch named develop and its base branch is main
  2. the package.json version is 1.0.0
  3. Using this action results in version 1-0-0-develop

Nested branches

  1. there is a branch named parent and its base branch is main
  2. now another branch child is based on parent
  3. there is already a version in parent - 1.0.0-parent.1
  4. Using this action for child results in version 1-0-0-child.1
  5. The nesting is not represented in the version!

Branch names with /

  1. there is a branch named feat/next-big-thing
  2. Using this action for feat/next-big-thing results in version 1-0-0-next-big-thing.1

Main branch

  1. there is a branch named main
  2. the package.json version is 1.0.0
  3. Using this action results in version 1-0-0

Inputs

  • branch: The name of the branch to check if the current branch is main or a dev-branch. Default main.
  • filePath: The json file path or file name where the version field is present. Default package.json.

Outputs

  • version: The generated version number.

Example usage

uses: trendoid/[email protected]
with:
  branch: feat/version-for-publishing
  filePath: ./package.json