Socket
Socket
Sign inDemoInstall

check-version-modules

Package Overview
Dependencies
1
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    check-version-modules

Check modules's version for the package.


Version published
Weekly downloads
35
increased by105.88%
Maintainers
1
Install size
74.4 kB
Created
Weekly downloads
 

Readme

Source

check-version-modules

Check modules's version for the package.

Build status Coverage status Dependency status Dev dependency status Issues Pull requests

Installation

$ npm install check-version-modules

Features

  • Extract package's dependencies & dev dependencies
  • Extract there versions
  • Compare them to the latest package's version

Doc

Supported patterns

does not support artifacts like "-beta" each "*" character will be understood like a "x"' here, "n" is a whatever number sample, like "1"

Does support following patterns:

  • x (=> x.x.x)
  • x.x.n (=> x.x.x)
  • x.n.n (=> x.x.x)
  • n (=> n.x.x)
  • n.x (=> n.x.x)
  • n.n (=> n.n.x)
  • n.n.n
  • ^n.n.n (=> n.x.x)
  • ~n.n.n (=> n.n.x)

Methods

  • (file: string, options?: iOptions) => Promise<boolean> extract & compare data

Interfaces

interface iOptions {
  "failAtMajor"?: boolean; // default: true => if no pattern, used for the returned boolean
  "failAtMinor"?: boolean; // default: true => if no pattern, used for the returned boolean
  "failAtPatch"?: boolean; // default: false => if no pattern, used for the returned boolean
  "dev"?: boolean; // default: true => analyze dev deps too
  "npmrcFile"?: string; // default: true => specify a npm configuration file (for private repositories)
}

Command line options

  • --fail-at-major => failAtMajor = true
  • --no-fail-at-major => failAtMajor = false
  • --fail-at-minor => failAtMinor = true
  • --no-fail-at-minor => failAtMinor = false
  • --fail-at-patch => failAtPatch = true
  • --no-fail-at-patch => failAtPatch = false
  • --dev => dev = true
  • --no-dev => dev = false
  • --npmrcFile => npmrcFile = next arg
  • --file => specify analyzed file with next argument, if not set analyze the "package.json" in the working directory

Examples

Command line

$ cd ./myProject/ && npx check-version-modules --file /etc/tests/package.json --fail-at-patch --no-dev
$ cd ./myProject/ && npx check-version-modules --no-fail-at-minor

Native

const checker = require("check-version-modules");

checker("/etc/tests/package.json", {
  "failAtPatch": true,
  "dev": false
}).then((analyze) => {
  console.log(analyze.result ? "ok": "old versions detected");
}).catch((err) => {
  console.error(err);
});

Typescript

import checker = require("check-version-modules");

checker("./package.json").then((analyze) => {
  console.log(analyze.result ? "ok": "old versions detected");
}).catch((err) => {
  console.error(err);
});

Tests

$ npm run-script tests
$ git clone git://github.com/Psychopoulet/check-version-modules.git
$ cd ./check-version-modules
$ npm install
$ npm run-script tests

License

ISC

Keywords

FAQs

Last updated on 08 Mar 2024

Did you know?

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc