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

npm-update

Package Overview
Dependencies
Maintainers
2
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

npm-update

npm update

  • 2.1.0
  • Source
  • npm
  • Socket score

Version published
Maintainers
2
Created
Source

npm-update

NPM version build status Test coverage node version npm download

npm update

Installment

$ npm i npm-update --save

Usage

const update = require('npm-update')
const pkg = require('../package.json')

(async () => {
  const { needUpdate } = await update({ pkg })
  if (needUpdate) return
  // do some stuff
})()

If needUpdate is true, print message:

╭─────────────────────────────────────────╮
│                                         │
│   new version x.y.z found               │
│                                         │
│   run npm i name@x -g                   │
│                                         │
╰─────────────────────────────────────────╯

Options

const {
  needUpdate,               // return true | false
  version: latestVersion,   // return version if needUpdate
} = await update(options)
  • options {object}
    • pkg {object} package.json object.
    • host {String} registry host, default is registry.npmjs.org.
    • timeout {Number} request registry timeout, default is 3000ms.
    • version {String} base version for comparing, can be npm tag or npm version, default is latest.
    • silent {Boolean} if slient is true, will not print message, default is false.

Contributors


xudafeng


brunoyang


zhangyuheng

This project follows the git-contributor spec, auto upated at Tue Jun 26 2018 22:22:45 GMT+0800.

License

The MIT License (MIT)

Keywords

FAQs

Package last updated on 01 Aug 2018

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