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 5.0.3 to 6.0.0

20

build/src/main.js

@@ -1,23 +0,19 @@

"use strict";var _got=_interopRequireDefault(require("got"));
import got from"got";
var _options=require("./options.js");
var _progress=require("./progress.js");function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}
import{getOpts}from"./options.js";
import{addProgress}from"./progress.js";
const fetchNodeWebsite=async function(path,opts){
const{mirror,progress}=(0,_options.getOpts)(path,opts);
export default async function fetchNodeWebsite(path,opts){
const{mirror,progress}=getOpts(path,opts);
const pathA=path.replace(LEADING_SLASH_REGEXP,"");
const response=await _got.default.stream(pathA,{prefixUrl:mirror});
const response=await got.stream(pathA,{prefixUrl:mirror});
(0,_progress.addProgress)(response,progress,path);
addProgress(response,progress,path);
return response;
};
}
const LEADING_SLASH_REGEXP=/^\//u;
module.exports=fetchNodeWebsite;
//# sourceMappingURL=main.js.map

10

build/src/mirror.js

@@ -1,6 +0,6 @@

"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.getMirrorEnv=void 0;var _process=require("process");
import{env}from"process";
const getMirrorEnv=function(){
export const getMirrorEnv=function(){
const mirrorName=MIRRORS.find(isDefinedEnv);

@@ -12,8 +12,8 @@

const mirror=_process.env[mirrorName];
const mirror=env[mirrorName];
return{mirror};
};exports.getMirrorEnv=getMirrorEnv;
};
const isDefinedEnv=function(name){
return _process.env[name]!==undefined&&_process.env[name].trim()!=="";
return env[name]!==undefined&&env[name].trim()!=="";
};

@@ -20,0 +20,0 @@

@@ -1,16 +0,16 @@

"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.EXAMPLE_OPTS=exports.DEFAULT_OPTS=exports.getOpts=void 0;var _filterObj=_interopRequireDefault(require("filter-obj"));
var _jestValidate=require("jest-validate");
import filterObj from"filter-obj";
import{validate}from"jest-validate";
var _mirror=require("./mirror.js");function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}
import{getMirrorEnv}from"./mirror.js";
const getOpts=function(path,opts={}){
export const getOpts=function(path,opts={}){
validateBasic(path,opts);
(0,_jestValidate.validate)(opts,{exampleConfig:EXAMPLE_OPTS});
validate(opts,{exampleConfig:EXAMPLE_OPTS});
const optsA=(0,_filterObj.default)(opts,isDefined);
const mirrorEnv=(0,_mirror.getMirrorEnv)();
const optsA=filterObj(opts,isDefined);
const mirrorEnv=getMirrorEnv();
const optsB={...DEFAULT_OPTS,...mirrorEnv,...optsA};
return optsB;
};exports.getOpts=getOpts;
};

@@ -23,9 +23,9 @@ const validateBasic=function(path){

const DEFAULT_OPTS={
export const DEFAULT_OPTS={
progress:false,
mirror:"https://nodejs.org/dist"};exports.DEFAULT_OPTS=DEFAULT_OPTS;
mirror:"https://nodejs.org/dist"};
const EXAMPLE_OPTS={
...DEFAULT_OPTS};exports.EXAMPLE_OPTS=EXAMPLE_OPTS;
export const EXAMPLE_OPTS={
...DEFAULT_OPTS};

@@ -32,0 +32,0 @@

@@ -1,13 +0,16 @@

"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.addProgress=void 0;var _stream=require("stream");
var _util=require("util");
import{finished}from"stream";
import{promisify}from"util";
var _chalk=require("chalk");
var _cliProgress=require("cli-progress");
var _figures=require("figures");
import{MultiBar}from"cli-progress";
import colorsOption from"colors-option";
import figures from"figures";
const pFinished=(0,_util.promisify)(_stream.finished);
const pFinished=promisify(finished);
const{green}=colorsOption();
const addProgress=async function(response,progress,path){
export const addProgress=async function(response,progress,path){
if(!progress||!showsBar()){

@@ -28,6 +31,6 @@ return;

stopBar(bar);
};exports.addProgress=addProgress;
};
const MULTIBAR_OPTS={
format:` ${(0,_chalk.green)(_figures.nodejs)} {prefix} {bar}`,
format:` ${green(figures.nodejs)} {prefix} {bar}`,
barCompleteChar:"\u2588",

@@ -44,3 +47,3 @@ barIncompleteChar:"\u2591",

const multibar=new _cliProgress.MultiBar(MULTIBAR_OPTS);
const multibar=new MultiBar(MULTIBAR_OPTS);

@@ -47,0 +50,0 @@

{
"name": "fetch-node-website",
"version": "5.0.3",
"main": "build/src/main.js",
"version": "6.0.0",
"type": "module",
"exports": "./build/src/main.js",
"main": "./build/src/main.js",
"files": [
"build/src",
"examples",
"!~"
"build/src/**/*.{js,ts,map,json,sh,md}",
"examples/**/*.{js,ts,map,json,sh,md}"
],

@@ -13,7 +14,2 @@ "scripts": {

},
"husky": {
"hooks": {
"pre-push": "gulp -LL check --full"
}
},
"description": "Fetch releases on nodejs.org",

@@ -54,21 +50,18 @@ "keywords": [

"dependencies": {
"chalk": "^4.0.0",
"cli-progress": "^3.7.0",
"cli-progress": "^3.8.2",
"colors-option": "^2.0.1",
"figures": "^3.2.0",
"filter-obj": "^2.0.1",
"got": "^10.7.0",
"jest-validate": "^25.3.0"
"got": "^11.8.2",
"jest-validate": "^27.0.2"
},
"devDependencies": {
"@ehmicky/dev-tasks": "^0.31.35",
"ava": "^3.6.0",
"get-stream": "^5.1.0",
"gulp": "^4.0.2",
"husky": "^4.2.5",
"sinon": "^9.0.1",
"test-each": "^2.0.0"
"@ehmicky/dev-tasks": "^1.0.34",
"get-stream": "^6.0.0",
"sinon": "^11.1.1",
"test-each": "^3.0.1"
},
"engines": {
"node": ">=10.17.0"
"node": ">=12.20.0"
}
}
[![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)
[![Build](https://github.com/ehmicky/fetch-node-website/workflows/Build/badge.svg)](https://github.com/ehmicky/fetch-node-website/actions)
[![Node](https://img.shields.io/node/v/fetch-node-website.svg?logo=node.js)](https://www.npmjs.com/package/fetch-node-website)
[![Gitter](https://img.shields.io/gitter/room/ehmicky/fetch-node-website.svg?logo=gitter)](https://gitter.im/ehmicky/fetch-node-website)
[![Twitter](https://img.shields.io/badge/%E2%80%8B-twitter-4cc61e.svg?logo=twitter)](https://twitter.com/intent/follow?screen_name=ehmicky)

@@ -19,3 +18,3 @@ [![Medium](https://img.shields.io/badge/%E2%80%8B-medium-4cc61e.svg?logo=medium)](https://medium.com/@ehmicky)

```js
const fetchNodeWebsite = require('fetch-node-website')
import fetchNodeWebsite from 'fetch-node-website'

@@ -40,2 +39,6 @@ const stream = await fetchNodeWebsite('v12.8.0/node-v12.8.0-linux-x64.tar.gz')

This package is an ES module and must be loaded using
[an `import` or `import()` statement](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c),
not `require()`.
# Usage

@@ -74,2 +77,6 @@

- [`get-node`](https://github.com/ehmicky/get-node): Download Node.js
- [`preferred-node-version`](https://github.com/ehmicky/preferred-node-version):
Get the preferred Node.js version of a project or user
- [`node-version-alias`](https://github.com/ehmicky/node-version-alias): Resolve
Node.js version aliases like `latest`, `lts` or `erbium`
- [`normalize-node-version`](https://github.com/ehmicky/normalize-node-version):

@@ -82,8 +89,4 @@ Normalize and validate Node.js versions

If you found a bug or would like a new feature, _don't hesitate_ to
[submit an issue on GitHub](../../issues).
For any question, _don't hesitate_ to [submit an issue on GitHub](../../issues).
For other questions, feel free to
[chat with us on Gitter](https://gitter.im/ehmicky/fetch-node-website).
Everyone is welcome regardless of personal background. We enforce a

@@ -90,0 +93,0 @@ [Code of conduct](CODE_OF_CONDUCT.md) in order to promote a positive and

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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