Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

auto-vers

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

auto-vers

<img src="https://codecov.io/gh/hu

  • 0.3.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
15
decreased by-48.28%
Maintainers
1
Weekly downloads
 
Created
Source

auto-vers

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.

Feature

  • upgrade major, minor, patch or prerelease
  • confirm update in cli
  • combine with git hooks

Usage

npm i auto-vers -g 

Cli

Base

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

Confirm

./bin/auto-vers -i -c

auto-vers-confirm.gif

Tip

./bin/auto-vers -t

auto-vers-tip1.gif

If you don't want to update , you can enter ctrl + c to exit program

Direct

./bin/auto-vers 1.2.0 

or

./bin/auto-vers -v 1.2.0 

auto-vers-direct.gif

options

auto-vers 0.2.0

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

Options
-v --version <version>
        Can change 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.

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 upgrade the version at the same time.

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

open the tip(-c --confirm), this is a safe way to update.

Instruction

Weights: version > tip > increment

increment-related: confirm, extra

License

MIT

Copyright (c) 2018 蓝色的秋风

FAQs

Package last updated on 19 Jan 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc