🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

hubtag

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hubtag

Emit events on Docker Hub image tag changes (currently limited to handle push events).

1.0.0
latest
Source
npm
Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

hubtag

Emit events on Docker Hub image tag changes (currently limited to handle push events).

Example Usage

import { TagWatcher } from 'hubtag';

new TagWatcher({ image: 'debian', tag: '10' })
	.on('push', (date) => console.log('image tag was updated', date))
	.on('error', (e) => console.error(e))
	.start();

Configuration

interface TagWatcherOptions {
	/**
	 * Image name (e.g. `debian` or `containrrr/watchtower`)
	 */
	image: string;
	/**
	 * Tag name (e.g. `10` or `c0mm17h45h`)
	 */
	tag: string;
	/**
	 * Interval in ms, defaults to 60 seconds
	 */
	interval?: number;
}

Events

error -> (e: Error) => void

Emits fetcher errors.

push -> (date: Date) => void

Emits push events, the date parameter is the last pushed timestamp.

fetch -> (result: any) => void

Emits successful fetches, the result parameter contains the parsed JSON response.

TagWatcher interface

interface ITagWatcher {
	isWatching: boolean;
	on<T extends keyof TagWatcherEvents>(evt: T, cb: TagWatcherEvents[T]): TagWatcher;
	off<T extends keyof TagWatcherEvents>(evt: T, cb: TagWatcherEvents[T]): TagWatcher;
	offAll<T extends keyof TagWatcherEvents>(evt?: T): TagWatcher;
	start(): TagWatcher;
	stop(): TagWatcher;
}

FAQs

Package last updated on 24 Mar 2021

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