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

fetch-node-website

Package Overview
Dependencies
Maintainers
1
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fetch-node-website - npm Package Compare versions

Comparing version 7.1.0 to 7.2.0

22

build/src/mirror.js

@@ -5,17 +5,6 @@ import{env}from"process";

export const getMirrorEnv=function(){
const mirrorName=MIRRORS.find(isDefinedEnv);
if(mirrorName===undefined){
return{};
}
const mirror=env[mirrorName];
return{mirror};
export const getDefaultMirror=function(){var _MIRRORS$map$find;
return(_MIRRORS$map$find=MIRRORS.map(getEnv).find(Boolean))!==null&&_MIRRORS$map$find!==void 0?_MIRRORS$map$find:DEFAULT_MIRROR;
};
const isDefinedEnv=function(name){
return env[name]!==undefined&&env[name].trim()!=="";
};
const MIRRORS=[

@@ -26,2 +15,9 @@ "NODE_MIRROR",

"NODIST_NODE_MIRROR"];
const getEnv=function(name){
return env[name];
};
const DEFAULT_MIRROR="https://nodejs.org/dist";
//# sourceMappingURL=mirror.js.map

@@ -1,5 +0,4 @@

import{excludeKeys}from"filter-obj";
import{validate}from"jest-validate";
import isPlainObj from"is-plain-obj";
import{getMirrorEnv}from"./mirror.js";
import{getDefaultMirror}from"./mirror.js";

@@ -9,28 +8,29 @@

validateBasic(path,opts);
validate(opts,{exampleConfig:EXAMPLE_OPTS});
const optsA=excludeKeys(opts,isUndefined);
const mirrorEnv=getMirrorEnv();
const optsB={...DEFAULT_OPTS,...mirrorEnv,...optsA};
return optsB;
const{progress=false,mirror=getDefaultMirror()}=opts;
validateProgress(progress);
validateMirror(mirror);
return{progress,mirror};
};
const validateBasic=function(path){
const validateBasic=function(path,opts){
if(typeof path!=="string"||path.trim()===""){
throw new TypeError(`Path must be a non-empty string: ${path}`);
}
if(!isPlainObj(opts)){
throw new TypeError(`Options must be a plain object: ${opts}`);
}
};
export const DEFAULT_OPTS={
progress:false,
mirror:"https://nodejs.org/dist"};
const validateProgress=function(progress){
if(typeof progress!=="boolean"){
throw new TypeError(`Option "progress" must be a boolean: ${progress}`);
}
};
export const EXAMPLE_OPTS={
...DEFAULT_OPTS};
const isUndefined=function(key,value){
return value===undefined;
const validateMirror=function(mirror){
if(typeof mirror!=="string"){
throw new TypeError(`Option "mirror" must be a string: ${mirror}`);
}
};
//# sourceMappingURL=options.js.map
{
"name": "fetch-node-website",
"version": "7.1.0",
"version": "7.2.0",
"type": "module",

@@ -50,14 +50,13 @@ "exports": "./build/src/main.js",

"cli-progress": "^3.11.2",
"colors-option": "^4.2.0",
"colors-option": "^4.4.0",
"figures": "^5.0.0",
"filter-obj": "^5.1.0",
"got": "^12.1.0",
"jest-validate": "^28.1.3"
"got": "^12.3.1",
"is-plain-obj": "^4.1.0"
},
"devDependencies": {
"@ehmicky/dev-tasks": "^1.0.84",
"@ehmicky/dev-tasks": "^1.0.94",
"@types/node": "^18.0.0",
"get-stream": "^6.0.0",
"sinon": "^14.0.0",
"test-each": "^5.2.0"
"test-each": "^5.4.1"
},

@@ -64,0 +63,0 @@ "engines": {

[![Codecov](https://img.shields.io/codecov/c/github/ehmicky/fetch-node-website.svg?label=tested&logo=codecov)](https://codecov.io/gh/ehmicky/fetch-node-website)
[![Node](https://img.shields.io/node/v/fetch-node-website.svg?logo=node.js)](https://www.npmjs.com/package/fetch-node-website)
[![TypeScript](https://img.shields.io/badge/-typed-brightgreen?logo=typescript&colorA=gray)](/src/main.d.ts)
[![TypeScript](https://img.shields.io/badge/-typed-brightgreen?logo=typescript&colorA=gray&logoColor=0096ff)](/src/main.d.ts)
[![Node](https://img.shields.io/node/v/fetch-node-website.svg?logo=node.js&logoColor=66cc33)](https://www.npmjs.com/package/fetch-node-website)
[![Twitter](https://img.shields.io/badge/%E2%80%8B-twitter-brightgreen.svg?logo=twitter)](https://twitter.com/intent/follow?screen_name=ehmicky)

@@ -5,0 +5,0 @@ [![Medium](https://img.shields.io/badge/%E2%80%8B-medium-brightgreen.svg?logo=medium)](https://medium.com/@ehmicky)

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