Socket
Book a DemoInstallSign in
Socket

package-version-sync

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

package-version-sync

get a json file (like package.json) get or increment version number of file and save

latest
Source
npmnpm
Version
0.0.2
Version published
Maintainers
1
Created
Source

package-version-sync

Automate the updating of your version number of your package with tools.

Build Status

Note that for those interested in a cli version I have one built. Let me know if you want it published

Installation

npm install package-version-sync --save-dev

Usage

Note that I'm using newer style node ES6 with TypeScript

import {version, Version, bumpVersionNumber, updateStringVersionNumber,
bumpFileVersion} from 'version'

const PACKAGE_PATH = './package.json'

version('./static.json') // => '0.0.0'

bumpVersionNumber(Version.Major, {version: '0.1.1'})) // => {version: '1.0.0'}

updateStringVersionNumber(Version.Major, '1.2.3')) // => '2.0.0'
updateStringVersionNumber(Version.Minor, '1.2.3')) // => '1.3.0'
updateStringVersionNumber(Version.Patch, '1.2.3')) // => '1.2.4'

var vOld = version(PACKAGE_PATH) // => 0.1.2

bumpFileVersion(PACKAGE_PATH, Version.Major)) // => 1.0.0

bumpFileVersion(PACKAGE_PATH, Version.Minor)) // => 1.1.0

bumpFileVersion(PACKAGE_PATH, Version.Patch)) // => 1.1.1

Keywords

package

FAQs

Package last updated on 26 May 2015

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