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

fast-tag

v2.5.2

Published

A simple cli tool that names tag, updates npm versions, and pushes to remote repository fastly.

Downloads

18

Readme

fast-tag

A simple CLI tool that names tags, updates the version number in package.json, and pushes them to the remote repository.

English | 简体中文

Installation

Global installation (recommended)

Install globally to use it anywhere.

npm install fast-tag --global

local installation

Open a command line in the project folder and install fast-tag:

npm install fast-tag --save-dev

Add the script in package.json:

{
  "script": {
    "tag": "ftag"
  }
}

Then input command npm run tag to execute fast-tag.

⚠ Notes

Since npm run xxx does not support pass-through of params, fast-tag will be restricted in usage. For example:

{
  "script": {
    "tag": "ftag",
    "tag:lerna": "ftag -L",
    "tag:m": "ftag -m"
  }
}

Therefore, if more params are needed, install globally is recommended.

Dependencies

Requires git to be installed and that it can be called using the command git.

Fast tag expects to do automatic version number update for package.json file, so it only can use in the npm project.

Usage

Introduction

ftag [options] [msg]

When you enter ftag, fast-tag will:

  • update local repo from the remote repo and try to merge
  • get the version number from the nearest package.json
  • increment the version number according to the options (Upgrade patch version by default)
  • save the new version number in the package.json file and push it to remote repo (commit message: ci: version ${version})
  • and then use the new version number as the tag name for git tag and push it to the remote repo

You can add msg as a commit message, fast tag will commit ALL uncommitted changes. If there are no uncommitted changes, msg will be used as the package.json submitted message.

Of course, it is recommended that before using the fast tag, you have already done the commit of the files, pull remote repo to the local, instead of relying on a ftag command to complete these things, which can maintain the independence of each command.

Examples

simple usage:

ftag

lerna repo:

ftag -L

patch tag with update the minor version number:

ftag -m

patch tag with submitting all changes:

ftag 'feat: add some new features'

Options

| abbr | full | effect | | ---- | ----------- | ------------------------------------------------------------------------------- | | -s | --small | (default) update PATCH version when you make backward compatible bug fixes | | -m | --medium | update MINOR version when you add functionality in a backward compatible manner | | -l | --large | update MAJOR version when you make incompatible API changes | | -i | --input | input any version number by yourself | | -n | --notupdate | use current version, not update package.json version number | | -b | --branch | concatenate part of the branch name* with the version number as tag name | | -L | --lerna | lerna mode, equal to --branch | | -d | --debug | show more output information for debugging | | -h | --help | display help for command |

part of the branch name*: If the branch name contains _ or / symbol, the branch name will be truncated and the previous part will be used.

Libraries

  • Simple Git - A lightweight interface for running git commands in any node.js application.
  • Commander.js - The complete solution for node.js command-line interfaces.

⚠ Notes

Simple Git depends on node.js version 12 or above, use in a lower version of node will result in errors.

It is recommended to use fast-tag in node.js version 12 or above. If you encounter this problem in the lower version, you can also submit an issue. The project will add polyfill in the later version.

Todo

  • use npm version [<newversion> | major | minor | patch | premajor | preminor | prepatch | prerelease [--preid=<prerelease-id>] | from-git] to update package.json version number.

Questions

What is the purpose of this tool?

The initial reason for coding this CLI tool is: the front-end projects currently under development add git tags frequently and cumbersomely. If you need to use the semantic version to name the tag version in a standardized way, you have to look at the previous tag version every time, then increase on its basis.

If there are other requirements, for example, we want to concatenate branch name with the version number as the tag name (like development_v1.1.4), or we want to tag and update the version number of package.json at the same time, we have to find the previous tag version and handle these tasks manually, which is not comfortable enough in terms of experience.

So fast-tag was born.

Will other commands are provided?

Currently, fast-tag only wants to patch tag well.

By the way, most of the effect can be implemented with git, such as the "one-click git add, commit, push", or the "alias ​​long command". It is not considered a good habit. Recommend memorizing the native command of git to make the use of git more flexible.