New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

new-version

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

new-version

A package which is frequently updated to a new version

  • 1.0.8
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

New Version

A package helps you to test if you lock version the right way.

Problem

Have you ever in a situation when one of your dependencies get updated, then it breaks your application. Then you try to lock version of that dependency. But it's hard to verify if your method of locking version is correct. new-version helps you by regularly update to a new version (currently: weekly), so you can verify if you do it the right way.

Usage

You can use node api or cli to check the current and newest version of package

Using CLI

Add this to your package.json

"scripts": {
  "new-version": "new-version"
},

then execute

npm run new-version

or simply

./node_modules/.bin/new-version

Using Node API

import NewVersion from 'new-version'

NewVersion.log();

Output:

Current version:  0.0.1
Newest version: 0.0.2

Demo

You can verify if your locking mechanism is configured correctly by including this script in index.js

// index.js
import NewVersion from 'new-version'

async function checkVersion() {
  const currentVersion = NewVersion.getCurrentVersion();
  const newestVersion = await NewVersion.getNewestVersion();
  if (currentVersion === newestVersion) {
    console.warn('You are installing newest package. Ignore if you just install this package within a week. Otherwise, you may want to check if you are locking version correctly')
  }
}

checkVersion();

API

getCurrentVersion

Return current installed version of new-version

getNewestVersion

Return newest version of new-version. This is an async function

log

Friendly log current version and newest version of new-version

Keywords

FAQs

Package last updated on 01 Dec 2020

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