CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/npm-update-notifier

Update notifications for your CLI app

Overall
score

97%

Overview
Eval results
Files

task.mdevals/scenario-4/

Pre-Release Version Tracker

Build a CLI tool that monitors pre-release versions of npm packages and notifies users when newer pre-release versions become available on specific distribution tags.

Requirements

Your tool should:

  1. Monitor a package for updates on a specific distribution tag (not just 'latest')
  2. Check for updates on a custom schedule
  3. Display formatted notifications when pre-release versions are available
  4. Work for packages installed both globally and locally
  5. Allow users to opt-out of notifications through environment variables

Specifications

Create a CLI tool named prerelease-checker that:

  • Accepts package metadata via a configuration object containing name and version
  • Checks for updates against a specific npm distribution tag (e.g., 'beta', 'next', 'canary')
  • Uses a custom check interval to determine update frequency
  • Displays notifications only in terminal environments
  • Respects the NO_UPDATE_NOTIFIER environment variable to disable checks

The tool should track packages on pre-release channels and notify users appropriately when newer versions are available on those channels.

Implementation

@generates

Test Cases

  • It checks for updates on a custom dist-tag @test
  • It respects the custom update check interval @test
  • It disables when NO_UPDATE_NOTIFIER is set @test
  • It displays notifications for beta versions @test

API

/**
 * Creates a pre-release version tracker
 * @param {Object} options - Configuration options
 * @param {Object} options.pkg - Package information
 * @param {string} options.pkg.name - Package name
 * @param {string} options.pkg.version - Current package version
 * @param {string} options.distTag - Distribution tag to track (e.g., 'beta', 'next')
 * @param {number} options.updateCheckInterval - Interval in milliseconds between checks
 * @returns {Object} Notifier instance with notify() method
 */
function createPreReleaseTracker(options) {
  // Implementation here
}

module.exports = { createPreReleaseTracker };

Dependencies { .dependencies }

update-notifier { .dependency }

Provides update notification functionality with support for custom distribution tags.

Install with Tessl CLI

npx tessl i tessl/npm-update-notifier

tile.json