API Reference
The package exposes one main entry, hashup(), plus a set of lower-level utilities for advanced use cases.
Entry Point
hashup(entry, options?)— resolve an entry file's full import graph and return a deterministic hash.
Utilities
createResolver()— build the enhanced-resolve instance used internally.resolveImport()— resolve a single import specifier.extractImports()— parse a file and return its static imports.hashFile()— hash a single file and its transitive imports.createContentHash()— SHA-256 a buffer.combineHashes()— fold a list of hashes into a single deterministic digest.createLogger(level?)— build theLoggerused internally. Exportstype LogLevelandtype Logger.isInNodeModules(file)— predicate used by the hasher to decide whether to walk into a resolved path.createHashupCache()— build aHashupCacheto share across multiplehashup()orhashFile()calls.collectReachable(roots, cache)— rebuild a per-call file list from the cache's dependency edges.
Config (subpath export)
The Zod schema and generated JSON schema for hashup.json live on a separate subpath so the main entry stays dep-free:
ts
import { configSchema, configJsonSchema } from "@maastrich/hashup/config";See the CLI guide for the config shape and editor integration.
Main entry
All core functions are exported from the package root:
ts
import {
hashup,
createResolver,
resolveImport,
extractImports,
hashFile,
createContentHash,
combineHashes,
createLogger,
isLogLevel,
isInNodeModules,
createHashupCache,
collectReachable,
type HashupCache,
type Logger,
type LogLevel,
} from "@maastrich/hashup";