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

parse-app-info

Package Overview
Dependencies
Maintainers
2
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

parse-app-info - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

34

index.js

@@ -5,3 +5,28 @@ const readPkgUp = require('read-pkg-up');

/**
* Information about the app
* A safe way to query for git infos.
*
* @return {object|undefined} Returns {hash, gitTag} or undefined in case of an error
*/
async function getLastCommit() {
try {
const lastCommitLog = new LastCommitLog();
const { hash, gitTag } = await lastCommitLog.getLastCommit();
// Add gitTag only when it exists
const result = {
hash
};
/* istanbul ignore if */
if (gitTag) {
result.tag = gitTag;
}
return result;
} catch (err) {}
}
/**
* Information about the app.
*
* The git infos can be missing if the project has no commit yet
* or is not connected to a git repo.
*
* @typedef {Object} AppInfo

@@ -25,7 +50,5 @@ * @property {string} name The name of the app

async function parseAppInfo() {
const lastCommitLog = new LastCommitLog();
const [packageInfo, lastCommit] = await Promise.all([
readPkgUp(),
lastCommitLog.getLastCommit()
getLastCommit()
]);

@@ -39,4 +62,3 @@

node: process.version,
hash: lastCommit.hash,
tag: lastCommit.gitTag,
...lastCommit,
environment: /* istanbul ignore next */ NODE_ENV || 'development',

@@ -43,0 +65,0 @@ hostname: /* istanbul ignore next */ HOSTNAME || require('os').hostname(),

2

package.json
{
"name": "parse-app-info",
"description": "parse information about an application process",
"version": "1.0.0",
"version": "1.0.1",
"author": "Philipp Kursawe <phil.kursawe@gmail.com> (https://pke.github.io)",

@@ -6,0 +6,0 @@ "ava": {

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