🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

specified-package-version-check

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

specified-package-version-check

check the specified package version is outdated or not

latest
npmnpm
Version
3.0.0
Version published
Maintainers
1
Created
Source

specified-package-version-check

[ENGLISH] | 中文

Introduce

specified-package-version-check is a script which can check the specified package version is outdated or not, if outdated, develop env process will be exist.

For some case, e.g. our team develop ourselves eslint rules as a npm package, if we update the npm package version, we hope all of our team member must use the latest npm version.

Usage

// Run this script first, e.g. { "start": node check && webpack-dev-server --open --history-api-fallback -d --colors}
//check.js
const checkDependenceVersion = require('specified-package-version-check');

async function func() {
  await checkDependenceVersion({
    dependenceArr: ['axios', 'eslint-config-ts-base'],
    useDepCheck: true,
    ignoreCheck: false,
    onlyWarn: false,
    checkAllLocalDependencies: false,
    ignoreSelf: false,
    remoteUrl: '',
  });

  console.log('end');
}

func();

API

PropertyDescriptionTypeDefaultrequiredVersion
dependenceArrdependence need to be checkedstring[][]true1.0.0
ignoreCheckskip checkbooleanundefinedfalse1.0.0
onlyWarnonly warn when specified package outdatedbooleanfalsefalse1.0.0
checkAllLocalDependenciescheck all packages version in package.jsonbooleanundefinedfalse1.0.0
ignoreSelfignore check @shuyun-ep-team/specified-package-version-checkbooleanundefinedfalse1.0.0
remoteUrlcheck specified npm global cli versionstringhttps://api-track.kylin.shuyun.com/monitor-service/static/global-package-info.jsonfalse1.0.0
uploadPackageInfoUrlupload package infostringhttps://api-track.kylin.shuyun.com/monitor-service/upload-package-infofalse1.2.1
useDepCheckuse depcheck to check useless dependencies and miss dependenciesbooleanundefinedfalse1.2.1
depcheckOptionsrefer to https://github.com/depcheck/depcheck#apiobject{}false1.2.1
autoFixOutdateDepauto fix outdate specified packagebooleantruefalse1.3.0
silenthide outputbooleanfalsefalse1.6.0
enableGlobalCliCheckcheck specified global npm package cli versionbooleantruefalse1.6.0

关于配置文件

Insert the following into script in package.json

{
  "prestart": "npx specified-package-version-check"
}

Command will read current folder's .spvrc.js where package.json is, if not found that file, console would happen an error

//.spvrc.js like as follows
module.exports = {
  dependenceArr: ['eslint-config-ts-base', 'put your deps here...'],
  ignoreCheck: false,
  onlyWarn: false,
  checkAllLocalDependencies: false,
  useDepCheck: true,
  autoFixOutdateDep: true,
};

something about remoteUrl json

json content construct must be as following

{
  "info": [
    {
      "command": "show version command", //e.g. yarn -v
      "name": "package name" //e.g. yarn
    }
  ]
}

Keywords

version

FAQs

Package last updated on 24 Aug 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts