Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@o-rango/update-notify

o-rango17MIT0.1.2

Check if an package needs to be update

npm, update-notify, npm-check, npm-info, update-dependencies

readme

@o-rango/update-notify

Build Status codecov

Inspired in update-notifier but using the default npm api that way is working behind proxy or any other config reflected in .npmrc.

It only has programmatic api and can be easily attached to your workflow.

Install

npm i --save @o-rango/updatet-notify

Usage

const { updateNotify } = require('@o-rango/update-notify');

const notifier = updateNotify({
      pkg: {
        version: '0.0.1',
        name: 'react'
      },
      updateCheckInterval: 0
    });


console.log(notifier);
// Output =>  

API

notify = updateNotify(options)

Checks if there is an available update. Accepts options defined below. Returns { updateAvailable: true , name: 'react' , latest: '16.11.0', 'current': '0.0.1' } if there is any update.

options

Type: object

pkg

Type: object

name

Required
Type: string

version

Required
Type: string

updateCheckInterval

Type: number
Default: 1000 * 60 * 60 * 24 (1 day)

How often to check for updates.

distTag

Type: string
Default: latest

Which dist-tag to use to find the latest version.

Extra

ping = pingRegistry()

Easter egg method that pings registry defined in your .npmrc;

const { pingRegistry } = require('@o-rango/update-notify');


const online = await pingRegistry();
// Output online => :{ isOnline : true }

changelog

Changelog

All notable changes to this project will be documented in this file. See standard-version for commit guidelines.

0.1.2 (2020-02-03)

Bug Fixes

  • error in update validation (a36b017)

0.1.1 (2020-01-22)

Bug Fixes

  • deps: update dependency execa to v3.4.0 (#6) (a7b0a83)
  • deps: update dependency execa to v4 (#9) (7feaba8)
  • deps: update dependency semver to v7 (#8) (4d74c5e)

0.1.0 (2019-12-19)

⚠ BREAKING CHANGES

  • n

Bug Fixes

  • 🐛 auto-update not writting new configstore (5499180)

0.0.4 (2019-11-18)

0.0.3 (2019-11-18)

Bug Fixes

  • 🐛 hangs on ping proxied registry (60bfbf9)

0.0.2 (2019-11-17)

Features