[](https://www.npmjs.com/package/@simpill/protocols.utils) [](https://github.com/SkinnnyJay/simpill-utils/tree/main/utils/@simpill-protocols.utils)
npm
npm install @simpill/protocols.utilsGitHub (from monorepo)
git clone https://github.com/SkinnnyJay/simpill-utils.git && cd simpill-utils/utils/@simpill-protocols.utils && npm install && npm run buildThen in your project: npm install /path/to/simpill-utils/utils/@simpill-protocols.utils or npm link from that directory.
import {
HTTP_METHOD,
type HttpMethod,
CORRELATION_HEADERS,
ENV_BOOLEAN_PARSING,
LOG_ENV_KEYS,
LOG_FORMAT_VALUES,
} from "@simpill/protocols.utils";- HTTP methods:
HTTP_METHOD,HttpMethod— GET, HEAD, POST, PUT, PATCH, DELETE, OPTIONS, QUERY (RFC 10008) - HTTP method registry:
HTTP_METHOD_PROPERTIES,AnyHttpMethod— IANAsafe/idempotentcolumns for all ten registered methods (RFC 9110, RFC 5789, RFC 10008) - Retry/cache primitives:
SAFE_HTTP_METHODS,IDEMPOTENT_HTTP_METHODS(+SafeHttpMethod,IdempotentHttpMethod) — the canonical inputs for HTTP client retry policies - Correlation:
CORRELATION_HEADERS—x-request-id,x-trace-id;CORRELATION_ID_PATTERN— canonical id shape[A-Za-z0-9._~-]{1,128}(do not reflect non-matching incoming ids) - W3C Trace Context:
TRACE_CONTEXT_HEADERS(traceparent,tracestate),TRACE_CONTEXT_VERSION,TRACEPARENT_PATTERN(strict version-00 shape, all-zero ids rejected). Kept separate fromCORRELATION_HEADERSso theCorrelationHeaderNameunion stays stable for consumers keyingRecords off it. - Env boolean:
ENV_BOOLEAN_PARSING— strict truthy["true","1"], falsy["false","0"];ENV_BOOLEAN_PARSING_EXTENDED— yn-convention sets (yes/no,y/n,on/off) for query strings and CLI flags - Log env:
LOG_ENV_KEYS,LOG_FORMAT_VALUES— keys and values for logger configuration
All exported constants are Object.freezed: a stray runtime assignment can no longer silently corrupt the fleet-wide source of truth (TypeScript's as const only protects at compile time).
@simpill/protocols.utils— all@simpill/protocols.utils/shared— same (package is shared-only)@simpill/protocols.utils/client— re-exports shared@simpill/protocols.utils/server— re-exports shared
- Runtime behavior — Constants, types, and validation patterns only; no env parsing, no HTTP client, no logger implementation. Use @simpill/env.utils, @simpill/http.utils, @simpill/logger.utils for behavior.
- Additional protocols — Only HTTP methods (and their IANA registry properties), correlation / W3C Trace Context header names and patterns, env boolean parsing policies, and log env keys; extend or use other packages for more.
Other @simpill packages (api.utils, http.utils, middleware.utils, env.utils, logger.utils) should import these types and constants from here instead of defining their own. See docs/adr/0001-utils-protocols-and-canonical-ownership.md.