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

preferred-node-version

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

preferred-node-version - npm Package Compare versions

Comparing version 3.2.0 to 3.3.0

32

build/src/options.js

@@ -1,35 +0,13 @@

import{cwd as getCwd}from"process";
import isPlainObj from"is-plain-obj";
import{excludeKeys}from"filter-obj";
import{validate,multipleValidOptions}from"jest-validate";
export const getOpts=function(opts={}){
validate(opts,{exampleConfig:EXAMPLE_OPTS()});
if(!isPlainObj(opts)){
throw new TypeError(`Options must be a plain object: ${opts}`);
}
const optsA=excludeKeys(opts,isUndefined);
const optsB={...DEFAULT_OPTS(),...optsA};
const{cwd,global:globalOpt,fetch:fetchOpt,mirror}=optsB;
const{cwd=".",global:globalOpt=false,fetch:fetchOpt,mirror}=opts;
const nodeVersionAliasOpts={fetch:fetchOpt,mirror};
return{cwd,globalOpt,nodeVersionAliasOpts};
};
const DEFAULT_OPTS=()=>({
cwd:".",
global:false});
const EXAMPLE_OPTS=()=>({
...DEFAULT_OPTS(),
cwd:multipleValidOptions(getCwd(),new URL(".",import.meta.url)),
fetch:true,
mirror:"https://nodejs.org/dist"});
const isUndefined=function(key,value){
return value===undefined;
};
//# sourceMappingURL=options.js.map

10

package.json
{
"name": "preferred-node-version",
"version": "3.2.0",
"version": "3.3.0",
"type": "module",

@@ -49,6 +49,4 @@ "exports": "./build/src/main.js",

"dependencies": {
"filter-obj": "^5.1.0",
"is-plain-obj": "^4.1.0",
"jest-validate": "^28.1.3",
"node-version-alias": "^3.2.0",
"node-version-alias": "^3.3.0",
"p-locate": "^6.0.0",

@@ -58,5 +56,5 @@ "path-type": "^5.0.0"

"devDependencies": {
"@ehmicky/dev-tasks": "^1.0.84",
"@ehmicky/dev-tasks": "^1.0.94",
"@types/node": "^18.0.0",
"test-each": "^5.2.0"
"test-each": "^5.4.0"
},

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

[![Codecov](https://img.shields.io/codecov/c/github/ehmicky/preferred-node-version.svg?label=tested&logo=codecov)](https://codecov.io/gh/ehmicky/preferred-node-version)
[![Node](https://img.shields.io/node/v/preferred-node-version.svg?logo=node.js)](https://www.npmjs.com/package/preferred-node-version)
[![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/preferred-node-version.svg?logo=node.js&logoColor=66cc33)](https://www.npmjs.com/package/preferred-node-version)
[![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