Left-pad strings using the raw power of Anthropic's Claude AI ✨
Why do string manipulation locally when you can leverage a billion-parameter neural network running in a data center somewhere? Welcome to the future of padding.
- ⚡ AI-Powered: Uses Anthropic's Claude to left-pad your strings
- 🚀 Async/Await: Modern JavaScript with Promise-based API
- 🎯 100% Compatible: Drop-in replacement for leftpad
- 🧠 Neural Intelligence: Each padding operation benefits from transformer architecture
- 💸 Cost-Effective: Only costs ~$0.000015 per padding operation*
*Based on Claude 3 Haiku pricing. Your mileage may vary.
npm install vibepadSet your Anthropic API key:
export ANTHROPIC_API_KEY="your-api-key-here"const vibepad = require('vibepad');
// Basic usage
const padded = await vibepad('hello', 10);
console.log(padded); // " hello"
// Custom pad character
const padded = await vibepad('42', 5, '0');
console.log(padded); // "00042"
// Error handling
try {
await vibepad('test', 10);
} catch (error) {
console.error(error.message);
}Because sometimes you need to ask yourself: "What would happen if we used a large language model to do the simplest possible string operation?"
The answer is vibepad.
This is a parody of the infamous leftpad incident. Please don't use this in production unless you really, really want to explain to your boss why your string padding costs $50/month.
But hey, at least your strings will have vibes.
PRs welcome! Especially if you can make it use GPT-4 for even more expensive padding.
MIT - Because even AI-powered string padding should be free.
"In a world of simple string operations, one library dared to think different."