trufflehog-js
Version:
TypeScript wrapper for TruffleHog secret scanner
85 lines (74 loc) • 1.5 kB
text/typescript
/**
* Copyright (c) 2025 maloma7. All rights reserved.
* SPDX-License-Identifier: MIT
*/
// Core types
export type {
ScanResult,
ScanOptions,
TruffleHogConfig,
PlatformInfo,
BinaryCacheInfo,
DownloadProgress,
LogLevel,
Logger,
GitStagedFile,
Platform,
} from "./types.ts";
export { ExitCode, SUPPORTED_PLATFORMS, TRUFFLEHOG_VERSION } from "./types.ts";
// Core scanner class
export { TruffleHogScanner } from "./scanner.ts";
// Convenience functions
export {
scanStagedFiles,
scanFiles,
scanText,
throwIfSecretsFound,
} from "./scanner.ts";
// Git utilities
export {
GitRepository,
getStagedFiles,
ensureGitRepository,
ensureHasStagedFiles,
getGitRoot,
} from "./git.ts";
// Platform utilities
export {
getCurrentPlatform,
getCurrentArch,
getPlatformKey,
getPlatformInfo,
isSupportedPlatform,
getSupportedPlatforms,
} from "./platform.ts";
// Cache utilities
export {
BinaryCache,
getBinaryFromCache,
setCachedBinary,
} from "./cache.ts";
// Download utilities
export { downloadBinary } from "./download.ts";
// Logger
export { createLogger, defaultLogger } from "./logger.ts";
// Errors
export {
TruffleHogError,
BinaryNotFoundError,
BinaryDownloadError,
BinaryVerificationError,
BinaryExecutionError,
ScanTimeoutError,
SecretsFoundError,
GitError,
PlatformNotSupportedError,
ConfigurationError,
NetworkError,
CacheError,
FileSystemError,
isRecoverableError,
getExitCodeFromError,
formatErrorForCLI,
handleProcessExit,
} from "./errors.ts";