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

@loopback/dist-util

Package Overview
Dependencies
Maintainers
17
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@loopback/dist-util - npm Package Compare versions

Comparing version 0.3.6 to 0.3.7

9

CHANGELOG.md

@@ -6,2 +6,11 @@ # Change Log

<a name="0.3.7"></a>
## [0.3.7](https://github.com/strongloop/loopback-next/compare/@loopback/dist-util@0.3.6...@loopback/dist-util@0.3.7) (2018-09-10)
**Note:** Version bump only for package @loopback/dist-util
<a name="0.3.6"></a>

@@ -8,0 +17,0 @@ ## [0.3.6](https://github.com/strongloop/loopback-next/compare/@loopback/dist-util@0.3.5...@loopback/dist-util@0.3.6) (2018-08-08)

27

index.js

@@ -9,11 +9,24 @@ // Copyright IBM Corp. 2018. All Rights Reserved.

const path = require('path');
const util = require('util');
const semver = require('semver');
/**
* Make sure node version meets the requirement. This file intentionally
* only uses ES5 features so that it can be run with lower versions of Node
* to report the version requirement.
*/
function checkNodeVersion(range) {
const nodeVer = process.versions.node;
const requiredVer = range || require('./package.json').engines.node;
const ok = semver.satisfies(nodeVer, requiredVer);
if (!ok) {
const format = 'Node.js %s is not supported. Please use a version %s.';
const msg = util.format(format, nodeVer, requiredVer);
throw new Error(msg);
}
}
function getDist() {
checkNodeVersion();
const nodeMajorVersion = +process.versions.node.split('.')[0];
if (nodeMajorVersion < 8) {
throw new Error(
`Node.js version ${process.versions.node} is not supported.` +
'Please use Node.js 8.9 or newer.',
);
}
return nodeMajorVersion >= 10 ? './dist10' : './dist8';

@@ -27,2 +40,2 @@ }

module.exports = {getDist, loadDist};
module.exports = {getDist, loadDist, checkNodeVersion};
{
"name": "@loopback/dist-util",
"version": "0.3.6",
"version": "0.3.7",
"description": "Select dist directory based on Node.js major version.",

@@ -12,2 +12,5 @@ "homepage": "https://github.com/strongloop/loopback-next/tree/master/packages/dist-select",

},
"dependencies": {
"semver": "^5.5.1"
},
"files": [

@@ -24,3 +27,4 @@ "index.js"

"copyright.owner": "IBM Corp.",
"license": "MIT"
"license": "MIT",
"gitHead": "b351268a9b150252573a3295d4fe650540576a60"
}
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