f / jev-leftpad
git clone https://github.com/f/jev-leftpad.git
Left-pad strings with TypeSafe AI's Jev. For reasons.
+0
stars, 24h · #29,556
+~0
stars, 7 days · #30,031
+84
stars, 30 days · #6,242
84
★ total
5
forks · 3 open issues
Star history (as recorded here)
LanguageJavaScript
LicenseMIT
Created2026-09-21 (1mo ago)
Last push1d ago
Watchers0
OwnerUser
Links
- GitHub: github.com/f/jev-leftpad
- Releases · Issues · Hacker News mentions
README excerpt
# jev-leftpad Left pad a value with Jev. Could this be one line with `padStart()`? Yes. Does it need a model call? No. Anyway: [code] [code] Set `TYPESAFE_API_KEY` before using it. `jev-leftpad` uses `jev-latest` through TypeSafe's native `@typesafe-ai/sdk`. It requires Node.js 20 or newer. ## API [code] `targetLength` must be a non-negative safe integer. Jev gets one Choice with criteria named `space_0`, `space_1`, `space_2`, and so on, written directly up to `space_10`. For the example above, it should choose `space_5`. JavaScript reads the number, creates five spaces, and puts the value after them. This means the package can add between 0 and 10 spaces. If more than 10 spaces are needed, Jev has no correct option. Which feels appropriate for this project. There is one TypeSafe API request per call and retries are disabled. The request can fail, Jev can choose the wrong option, and it costs more than `padStart()`. Please don't use this in production. Or anything important. ## Development [code] The tests mock Jev. They don't need an API key and don't spend any TypeSafe credits. ## License MIT