stdlib-but-with-api-billing
v0.1.0
Published
A fake serious utility library that routes trivial operations through the GPT API.
Maintainers
Readme
stdlib-but-with-api-billing
Mission-critical utility functions for teams that believe Array.prototype.sort() is too tightly coupled to local compute.
This package replaces fast, deterministic built-ins with premium network latency and per-token pricing.
Features
- Sort arrays by asking a frontier model to kindly reorder them
- Evaluate boolean expressions with a prompt instead of an interpreter
- Reverse strings through a state-of-the-art remote reasoning pipeline
- Parse numbers with organizational alignment and API billing
Install
npm installSetup
export OPENAI_API_KEY="your_api_key_here"Optional overrides:
export OPENAI_MODEL="gpt-4.1-mini"Demo
npm run demoExample
import {
sortArrayWithCorporateSynergy,
solveBooleanExpressionWithLeadershipAlignment,
reverseStringWithPremiumLatency,
parseNumberWithConfidence
} from "stdlib-but-with-api-billing";
const sorted = await sortArrayWithCorporateSynergy([9, 3, 5, 1]);
const boolResult = await solveBooleanExpressionWithLeadershipAlignment("true && (false || true)");
const reversed = await reverseStringWithPremiumLatency("technical debt");
const numberValue = await parseNumberWithConfidence("0042");
console.log({ sorted, boolResult, reversed, numberValue });Why
Local execution is cheap, reliable, and sensible. This library rejects all three.
API
sortArrayWithCorporateSynergy(values)
Returns a numerically ascending copy of values, but only after consulting a language model.
solveBooleanExpressionWithLeadershipAlignment(expression)
Evaluates a boolean expression containing true, false, &&, ||, !, and parentheses.
reverseStringWithPremiumLatency(value)
Returns the reversed string after a fully unnecessary round trip.
parseNumberWithConfidence(input)
Returns a JavaScript number parsed from text by outsourcing the concept of digits.
