Skip to content
Tech News
← Back to articles

Jev-Leftpad

read original more articles
Why This Matters

This is a satirical npm package that mocks the overuse of AI/LLM calls for trivial programming tasks that JavaScript already solves natively, like padStart(). It highlights industry concerns about unnecessary API dependencies, cost, latency, and reliability when AI is misapplied to simple problems, serving as a cautionary joke for developers tempted to add AI to everything.

Key Takeaways

Left pad a value with Jev.

Could this be one line with padStart() ? Yes. Does it need a model call? No. Anyway:

npm install jev-leftpad

import leftPad from 'jev-leftpad' ; const result = await leftPad ( 'jev' , 8 ) ; console . log ( JSON . stringify ( result ) ) ; // " jev" (probably)

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

await leftPad ( value , targetLength )

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.

... continue reading