🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

get-project-version

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

get-project-version - npm Package Compare versions

Comparing version

to
1.0.2

15

lib/index.js

@@ -42,7 +42,16 @@ 'use strict';

const regexVarCommit = /\{\{ *commit *\}\}/i;
const commit = options.commit || _gitRevSync2.default.short(options.cwd);
const tag = options.tag || _gitRevSync2.default.tag(options.cwd);
const resultVersion = regexVersion.exec(tag);
let commit;
let tag;
let resultVersion;
let version;
try {
commit = options.commit || _gitRevSync2.default.short(options.cwd);
tag = options.tag || _gitRevSync2.default.tag(options.cwd);
resultVersion = regexVersion.exec(tag);
} catch (error) {
commit = 'no commit';
}
// if git tag does not have a version number read in from package.json

@@ -49,0 +58,0 @@ if (resultVersion) {

2

package.json
{
"name": "get-project-version",
"version": "1.0.1",
"version": "1.0.2",
"description": "This module will return the current project version string. The version string is made of the last git tag or package.json version (if no git tag exists) and the last commit hash.",

@@ -5,0 +5,0 @@ "main": "lib/index.js",