Socket
Socket
Sign inDemoInstall

@hyperledger/caliper-core

Package Overview
Dependencies
20
Maintainers
4
Versions
262
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.3.1-unstable-20200316171957 to 0.3.1-unstable-20200318134957

25

lib/common/utils/caliper-utils.js

@@ -151,2 +151,27 @@ /*

/**
* Check if a named module is installed and accessible by caliper
* @param {string} moduleName the name of the module to check
* @param {Function} requireFunction The "require" function (with appropriate scoping) to use to load the module.
* @returns {boolean} boolean value for existence of accessible package
*/
static moduleIsInstalled(moduleName, requireFunction = require) {
let modulePath;
if (moduleName.startsWith('./') || moduleName.startsWith('/')) {
// treat it as an external module, but resolve the path, so it's absolute
modulePath = CaliperUtils.resolvePath(moduleName);
} else {
// treat it as a package dependency (user must install it beforehand)
modulePath = moduleName;
}
try {
CaliperUtils.loadModule(modulePath, requireFunction);
return true;
} catch (err) {
// If the module can not be found, an error is thrown
return false;
}
}
/**
* Utility function to check for singleton values

@@ -153,0 +178,0 @@ * @param {string[]} passedArgs arguments passed by user

2

package.json
{
"name": "@hyperledger/caliper-core",
"description": "Core Hyperledger Caliper module, used for running performance benchmarks that interact with blockchain technologies",
"version": "0.3.1-unstable-20200316171957",
"version": "0.3.1-unstable-20200318134957",
"repository": {

@@ -6,0 +6,0 @@ "type": "git",

SocketSocket SOC 2 Logo

Product

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc