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

all-node-versions

Package Overview
Dependencies
Maintainers
1
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

all-node-versions - npm Package Compare versions

Comparing version 9.0.0 to 10.0.0

4

build/src/cache/file.js

@@ -1,2 +0,2 @@

import{promises as fs}from"fs";
import{readFile}from"fs/promises";
import{env}from"process";

@@ -19,3 +19,3 @@

export const getCacheFileContent=async function(cacheFile){
const cacheFileContent=await fs.readFile(cacheFile,"utf8");
const cacheFileContent=await readFile(cacheFile);
const{lastUpdate,...versionsInfo}=JSON.parse(cacheFileContent);

@@ -22,0 +22,0 @@ const age=Date.now()-lastUpdate;

@@ -1,2 +0,2 @@

import pathExists from"path-exists";
import{pathExists}from"path-exists";

@@ -17,4 +17,4 @@ import{

export const readCachedVersions=async function(fetch){
if(fetch===true){
export const readCachedVersions=async function(fetchOpt){
if(fetchOpt===true){
return;

@@ -31,3 +31,3 @@ }

if(isOldCache(age,fetch)){
if(isOldCache(age,fetchOpt)){
return;

@@ -39,4 +39,4 @@ }

const isOldCache=function(age,fetch){
return age>MAX_AGE_MS&&fetch!==false;
const isOldCache=function(age,fetchOpt){
return age>MAX_AGE_MS&&fetchOpt!==false;
};

@@ -43,0 +43,0 @@

export const groupBy=function(array,group){
const mapper=getMapper(group);
return groupByFunc(array,mapper);
};
const getMapper=function(group){
if(typeof group==="function"){
return group;
}
if(typeof group==="string"){
return getByProp.bind(undefined,group);
}
if(Array.isArray(group)){
return getByProps.bind(undefined,group);
}
throw new Error(`Group must be a function, property or array of properties`);
};
const getByProps=function(propNames,object){
let keys="";
for(const propName of propNames){
const key=getByProp(propName,object);
keys=keys===""?key:`${keys}.${key}`;
}
return keys;
};
const getByProp=function(propName,object){
if(object===null||typeof object!=="object"){
return"";
}
return String(object[propName]);
};
const groupByFunc=function(array,mapper){
const object={};

@@ -54,3 +8,3 @@

for(const item of array){
const key=String(mapper(item));
const key=String(item[group]);

@@ -57,0 +11,0 @@

@@ -12,4 +12,4 @@ import{env}from"process";

export default async function allNodeVersions(opts){
const{fetch,...fetchNodeOpts}=getOpts(opts);
const versionsInfo=await getAllVersions(fetch,fetchNodeOpts);
const{fetch:fetchOpt,...fetchNodeOpts}=getOpts(opts);
const versionsInfo=await getAllVersions(fetchOpt,fetchNodeOpts);
return versionsInfo;

@@ -19,6 +19,6 @@ }

const getAllVersions=async function(fetch,fetchNodeOpts){
const getAllVersions=async function(fetchOpt,fetchNodeOpts){
if(
processCachedVersions!==undefined&&
fetch!==true&&
fetchOpt!==true&&
!env.TEST_CACHE_FILENAME)

@@ -29,3 +29,3 @@ {

const versionsInfo=await getVersionsInfo(fetch,fetchNodeOpts);
const versionsInfo=await getVersionsInfo(fetchOpt,fetchNodeOpts);

@@ -42,9 +42,10 @@

const getVersionsInfo=async function(fetch,fetchNodeOpts){
const cachedVersions=await readCachedVersions(fetch);
const getVersionsInfo=async function(fetchOpt,fetchNodeOpts){
const cachedVersions=await readCachedVersions(fetchOpt);
return cachedVersions===undefined?
await getNewVersionsInfo(fetchNodeOpts):
cachedVersions;
};
if(cachedVersions!==undefined){
return cachedVersions;
}
const getNewVersionsInfo=async function(fetchNodeOpts){
try{

@@ -51,0 +52,0 @@ const index=await fetchIndex(fetchNodeOpts);

@@ -58,5 +58,7 @@ import semver from"semver";

const compareMajor=function({major:majorA},{major:majorB}){
/* c8 ignore next */
return majorA<majorB?1:-1;
};
//# sourceMappingURL=normalize.js.map
{
"name": "all-node-versions",
"version": "9.0.0",
"version": "10.0.0",
"type": "module",

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

"fetch-node-website": "^6.0.0",
"filter-obj": "^2.0.2",
"filter-obj": "^3.0.0",
"get-stream": "^6.0.0",
"global-cache-dir": "^3.0.1",
"jest-validate": "^27.0.2",
"path-exists": "^4.0.0",
"semver": "^7.3.5",
"write-file-atomic": "^3.0.3"
"jest-validate": "^27.5.1",
"path-exists": "^5.0.0",
"semver": "^7.3.6",
"write-file-atomic": "^4.0.1"
},
"devDependencies": {
"@ehmicky/dev-tasks": "^1.0.34",
"@ehmicky/dev-tasks": "^1.0.72",
"is-plain-obj": "^4.0.0",
"test-each": "^3.0.1"
"test-each": "^4.0.0"
},
"engines": {
"node": ">=12.20.0"
"node": ">=14.18.0"
}
}

@@ -105,3 +105,3 @@ [![Codecov](https://img.shields.io/codecov/c/github/ehmicky/all-node-versions.svg?label=tested&logo=codecov)](https://codecov.io/gh/ehmicky/all-node-versions)

Base URL to fetch the list of available Node.js versions. Can be customized (for
example `https://npm.taobao.org/mirrors/node`).
example `https://npmmirror.com/mirrors/node`).

@@ -108,0 +108,0 @@ The following environment variables can also be used: `NODE_MIRROR`,

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