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

build-data

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

build-data - npm Package Compare versions

Comparing version 0.2.0 to 0.2.1

39

index.js
'use strict';
const fs = require('fs');
const path = require('path');
const branchName = require('branch-name');
const buildVersion = require('build-version');
const realpath = (fp) => {
return new Promise((resolve, reject) => {
fs.realpath(fp, (err, resolvedPath) => {
if (err) {
reject(err);
return;
}
resolve(resolvedPath);
});
});
};
const buildData = (option) => {

@@ -20,2 +34,27 @@ const config = Object.assign({}, option);

buildData.latest = (option) => {
const config = Object.assign(
{
cwd : ''
},
option
);
if (config.branch && config.version) {
return Promise.resolve({
branch : config.branch,
version : config.version
});
}
const linkPath = config.branch ? path.join('build', config.branch, 'latest') : 'latest-build';
return realpath(path.join(config.cwd, linkPath)).then((resolvedPath) => {
return {
branch : config.branch || path.basename(path.join(resolvedPath, '..')),
version : config.version || path.basename(resolvedPath)
};
});
};
module.exports = buildData;

2

package.json
{
"name": "build-data",
"version": "0.2.0",
"version": "0.2.1",
"description": "Get metadata for your build.",

@@ -5,0 +5,0 @@ "homepage": "https://github.com/sholladay/build-data",

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