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

auto-vers

v1.0.3

Published

<p align="center"> <a href="https://travis-ci.org/hua1995116/auto-version"><img src="https://travis-ci.org/hua1995116/auto-version.svg?branch=master" /></a> <a href="https://codecov.io/gh/hua1995116/auto-version"><img src="https://codecov.io/gh/hu

Downloads

102

Readme

auto-vers

Language

中文版 English

Auto update version for your application

auto-vers is helpful to your work. It will auto update package version when build your application.

When you iterate over your application, updating the version is a trivial but indispensable little thing. You can run it while packaging your app, and then will do more with less.

Similar

|project | npm-auto-version | update-version | auto-vers | | -------- | -----: | :----: | :----: | | git tag | ⭕️ | ❌ | ⭕️ | | auto version | ❌ | ⭕️ | ⭕️ | | tip update | ❌ | ❌ | ⭕️ |

Feature

  • [x] Update major, minor, patch, premajor, preminor, prepatch or prerelease
  • [x] Confirm update in cli
  • [x] Support git tag
  • [ ] According to the recommended version of git commit

Usage

Two ways of Node and Cli

npm i auto-vers -g 

Cli

Base

cat package.json
{
    ...
    "version": "1.0.0"
    ...
}
auto-vers -i
cat package.json
{
    ...
    "version": "1.0.1"
    ...
}

Confirm

auto-vers -i -c

auto-vers-confirm.gif

Tip

auto-vers -t

auto-vers-tip1.gif

Don't want to update, enter ctrl + c to exit program

Tip && Git

Select a verison. And then will commit a tag && make a tag && push tag.

auto-vers -t -g 

Direct

auto-vers 1.2.0 

or

auto-vers -v 1.2.0 

auto-vers-direct.gif

options

auto-vers 1.0.2

Auto update version for your application
Usage: auto-vers [options] <version> [[...]]

Options
-v --version <version>
        Can update version directly.
-i --inc --increment [<level>]
        Increment a version by the specified level. Level can
        be one of: major, minor, patch, premajor, preminor
        , prepatch or prerelease. Default level is 'patch'.
        Only one version may be specified.
-e --extra [<value>]
        This is for prerelease extra data
        Such as 'beta','alpha'
-c --confirm
        Do not update the version directly, you can confirm.
        This is a safe mode.
-t --tip
        Provide choice to you. If you don't know how to update
        you can choose this option.
-g --git
        Help you make a tag.(Make you have a git repo)

Node

npm i auto-vers

package.json

{
    ...
    "version": "1.0.0"
    ...
}

index.js

const autoVers = require('auto-vers');

autoVers({type: 'patch'}); // 1.0.1
node index.js

update package.json

{
    ...
    "version": "1.0.1"
    ...
}

options

{
    version?: <version>,
    type: major | minor | patch | prerelease,
    url?: package.json's url,
    extra?: alpha | beta | ...
}

Practices

It is a good choice to build your application and update the version at the same time.

Primary

"script": {
    "build": "babel ./src --out-dir ./dist",
    "tip": "npm run build && auto-vers -t",
}

After you write a build command, followed by auto-vers -t, you will be prompted what versions you need to update, which will have some indication for you. Help you better judge what version you need to update to. auto-vers -t -g This command is suitable for you to release a separate version, which can help you modify the package.json -> git commit -> git tag -> git push origin [tagname] from the whole process.

Intermediate

"script": {
    "build": "babel ./src --out-dir ./dist",
    "patch": "npm run build && auto-vers -i -c",
    "minor": "npm run build && auto-vers -i minor -c",
    "major": "npm run build && auto-vers -i major -c",
    "beta": "npm run build && auto-vers -i prerelease -c",
}

This method is for people who are familiar with this mode, and only need to execute the simple command each time they need to update. (Increase the parameter -c --confirm, this is a safe way to update, to help you confirm whether the update is correct, if it is a cumbersome step for you to remove.)

Advanced

git-hooks

If you have not registered pre-commit && post-commit, please move directly.

mv githook-*/*  .git/hooks/

Git hooks exist.

cat githook-*/pre-commit >> .git/hooks/pre-commit

When you commit the 'commit', it will automatically pop out of the selection interface, select and update the correct version. (Note: There is a related commit command in your program, use --no-verify to skip this hook, otherwise it will be called in a loop)

Tip:

Because it automatically pushes you when you tag, there will be a network delay. Please ensure that you execute this command in a network.

Instruction

Weights: version > tip > increment

increment-related: confirm, extra

About

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.

License

MIT

Copyright (c) 2018 蓝色的秋风