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

check-version-modules

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

check-version-modules

Check modules's version for the package.

  • 1.2.1
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

check-version-modules

Check modules's version for the package.

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

/!\ Warning ! This package is designed to work only with strict version, without artefacts ("^", "~", etc...)

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

Methods

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

Interfaces

interface iOptions {
  "failAtMajor": boolean; // default: true => used for the returned boolean
  "failAtMinor": boolean; // default: true => used for the returned boolean
  "failAtPatch": boolean; // default: false => used for the returned boolean
  "dev": boolean; // default: true => analyse dev deps too
  "console": boolean; // default: true => print analyse's result in the terminal
}

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
  • --console => console = true
  • --no-console => console = false
  • --file => specify analysed file with next argument, if not set analyse 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-console --no-fail-at-minor

Native

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

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

Typescript

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

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

Tests

$ npm run-script tests

License

ISC

Keywords

FAQs

Package last updated on 16 Jul 2019

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

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