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

gh-pages-tagged

v2.2.3

Published

handy tool to publish multiple versions of a repo on github pages

Downloads

5

Readme

gh-pages-tagged

A minimalistic but handy cli tool to publish multiple versions of a repo on github pages. This project is independent of the original gh-pages package and you are not recommended to use both as using gh-pages will essentially destroy all your previous tagged version.

API

Currently, this package supports only two command line options,

  1. --dir : name of the directory you wantto publish
    Required, "." means to publish the entire contents of the present directory, useful if you have trivial pages with only index.html, index.js etc.

  2. --version : name of the version that you want it to have on github pages
    Optional, defaults to 'latest', please respect semantic versioning and name your versions like: v1.0.0, v8.3.2 or 2.3.1. If you the version number is not semantic or 'latest' it might get removed during the building phase of this package.

Examples:

  1. npx gh-pages-tagged --dir=dist --version=v2.0.0
    will publish your page at https://username.github.io/repoName/v2.0.0.

  2. npx gh-pages-tagged --dir=build
    will publish your page at https://username.github.io/repoName/latest.

How it works

Normally, this is what gh-pages does:

  • creates a branch named gh-pages
  • puts all the content of the folder that you specify in this branch, everything else is deleted
  • tells github to set gh-pages as the github pages branch

this is really great for bundlings tool and things like CRA, but does not help with versioned or tagged github pages.

gh-pages-tagged aims to provide users with tagged gh-pages. So basically this is what gh-pages-tagged does:

  • creates a folder(--version option) inside the gh-pages branch.
  • copies the specified content(--dir option) into the above folder
  • creates a commit
  • pushes this commit to github

The published tagged version can then be accessed by <url>/tagName, the original url always points to url/latest

Contribution

Please feel free to raise issues, queries or Pull requests. This is really my first npm package to have been published on npm, I am open to conversations about this or really any other projects of mine. My github should be linked at the sidebar, the repo link can be found here

TODO (PRs and any help welcome)

  1. add functionality to clean the gh-pages branch entirely if the user wishes to do so
  2. Improve repo copying algorithm to prevent node_modules and another unnessary files from copying-hence decreasing the overall time taken by this tool
  3. Improve the general code structure of this repo
  4. Add tests for functions

Wow There is already X package that does this

Sure, you are perfectly entitled to make your own decisions in life. I have no intention to challange your right to freedom. This package is built not only as a minimalistic utlity but also a good learning project for me. The goal of this package is not to be perfect but to be learning experience for me whilst also contributing something to npm.