requireString (dockerhub/utils.js)

OpenCLI · clis/dockerhub/utils.js · javascript · Apache-2.0
infra, Infra / DevOps

Offers helper functions for Docker Hub API interactions, including string validation, bounded integers, image parsing, and authenticated fetch.

// Source: https://github.com/jackwener/OpenCLI | License: Apache-2.0 | Copyright You must retain, in the Source form of any Derivative Works
// Provided via justclaw.it.com; keep this notice with the code.
// Shared helpers for the Docker Hub adapters.
//
// Hits the public, unauthenticated `hub.docker.com/v2` REST endpoints. Anonymous
// pulls are throttled but search / metadata reads are friendly enough for
// ad-hoc CLI use. Image names follow `[<owner>/]<name>` with `library` as the
// implicit owner for Docker official images.
import { ArgumentError, CommandExecutionError, EmptyResultError } from '@jackwener/opencli/errors';

export const HUB_BASE = 'https://hub.docker.com/v2';
const UA = 'opencli-dockerhub-adapter (+https://github.com/jackwener/opencli)';

// Docker Hub repository s

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key